On 1/3/07, Jerry McAllister <[EMAIL PROTECTED]> wrote:
On Wed, Jan 03, 2007 at 03:07:43PM -0500, Robert Huff wrote:

>
>       This is probably staring me in the face:
>
> if [ ! -d "foo"]
>       then mkdir foo
> fi
>
>       gives me:
>
> [: missing ]

It is probably not telling you ':' missing but ';' missing.
It goes after the ']', plus I think the space before ']' is required.

////jerry

>
>       Looking at rc.subr I see:
>
> if [ ! -d "$linkdir" ]; then
>            warn "$_me: the directory $linkdir does not exist."
>            return 1
> fi
>
>
>                                       Robert Huff
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

the ';' is not required if the 'then' statement is not on the same
line as the 'if' statement.

[EMAIL PROTECTED] ~% sh
$ if echo foo
then
echo bar
fi
foo
bar


sorry for the repeat jerry
(gmail's reply defaults to replying to just the sender and not everyone)


--
The biggest problem with communication is the illusion that it has occurred.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to