Russell Bevers wrote:
>
> I have been unable to get the '[' command to work in shell scripts. I've
> checked the docs and supposedly '[' is a command in the MPE/ix POSIX shell
> (e.g. if [ -f doiexist.c ]
> then
> .
> .
> fi )
I write this construct as:
if [ -f doiexist.c ]; then
.
.
fi
>
> but all my scripts that utilize it return
>
> ./scriptname linenum: [: not found
>
> I thought this was a shell internal command? But the docs also say there
> is a man page for [. I have yet to find it . . .
>
> Can anyone enlighten me here?
[] is shorthand for the test command. Try "man test".
- Mark B.