Actually, [ is a link to test. Linux uses a symlink, some Unixes use hard links. -rwxr-xr-x 1 root root 17496 Sep 20 2001 /usr/bin/test lrwxrwxrwx 1 root root 4 Dec 1 13:42 /usr/bin/[ -> test
And yes, BASH has it built in, but on some of the older Bourne shells it is not built in. Speaking of builtin commands vs. Unix commands. While setting the PATH environment variable in a script is a good idea, specifying the full path to a standard command may be a better way. The user may have aliased the commands: alias rm='rm -i' So, in your script (or makefile), setting a variable for the command will bypass any aliases: RM=/bin/rm Same with any other Unix command. So, for the reason of unpredictable aliases, X=$(/usr/bin/ls) Is the more predicatable way to proceed. On 21 Apr 2002 at 22:31, Tom Buskey wrote: > > Benjamin Scott said: > > > If you are not interested in portability to older shells, here are some > >optimizations: > > > > > > math=$(( 1 + 1 )) # internal, easier, nestable > > > > if [[ a = b ]]; ... # internal > > I've had problems with [[ ]] on pdksh in the past. [ ] is also > internal on modern unixen. > > > > > Anyone else have some tips or tricks they would like to share? > > > > I've done lots of cross platform scripting. I find it's better to set > PATH in the top of the script rather then do things like: > > X=$(/usr/bin/ls) > > PATH=/usr/bin:$PATH > X=$(ls) > > I've also created something like an include file that I . at the top of > my scripts. It has functions I use & defines variables for thing like > mail. For instance: > date | $MAILER -s 'feedback' user@site > > On linux, MAILER=mail. Solaris, MAILER=mailx. > > Scripts attached. > -- Jerry Feldman <[EMAIL PROTECTED]> Associate Director Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 ***************************************************************** To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *****************************************************************
