OT: stupid sh scripting question

Jerry McAllister jerrymc at msu.edu
Wed Jan 3 13:23:09 PST 2007


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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list