> > use != instead of -ne > > > > man test for the gore. > > Be aware that `test` is an external program whereas the standard `if [ ]` > construct is built into your shell. There may be inconsistencies with the > type of tests that they support.
I have some doubts about this distinction. If you look into the details, you'll find that "if" is part of the shell's control flow, and that "[" and "test" are in fact the same program (there's a symlink). If it's used as "[", it'll moan if its last argument is not "]", although this last argument does absolutely nothing but keep the sh syntax look better. Once upon a time, sh would have had neither "[" nor "test" and both would have been an external program. With bigger hardware it was ok to integrate a copy of them into sh itself for efficiency (calling external programs creates overheads), and there's no point integrating one without the other, as they are in fact the same anyway. Looking at the bloated size of the /bin/bash binary, there better be a lot more than just "test" integrated as well. Volker -- Volker Kuhlmann is list0570 with the domain in header http://volker.dnsalias.net/ Please do not CC list postings to me.
