HP3000-L Archives

May 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Mon, 15 May 2000 09:30:15 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
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.

ATOM RSS1 RSS2