Re: OT: stupid sh scripting question

2007-01-03 Thread Garrett Cooper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevin Downey wrote: > 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 fo

Re: OT: stupid sh scripting question

2007-01-03 Thread Matthew Seaman
Robert Huff wrote: > This is probably staring me in the face: > > if [ ! -d "foo"] Missing space ^ here. ie: if [ ! -d "foo" ] then mkdir foo fi or perhaps more succinctly: [ -d "foo" ] || mkdir "foo" or best of all, maybe just: mkdir -p "foo"

Re: OT: stupid sh scripting question

2007-01-03 Thread Kevin Downey
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

Re: OT: stupid sh scripting question

2007-01-03 Thread Jerry McAllister
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 thin

Re: OT: stupid sh scripting question

2007-01-03 Thread Dan Nelson
In the last episode (Jan 03), Robert Huff said: > > This is probably staring me in the face: > > if [ ! -d "foo"] > then mkdir foo > fi > > gives me: > > [: missing ] > > Looking at rc.subr I see: > > if [ ! -d "$linkdir" ]; then >warn "$_me: the directory

Re: OT: stupid sh scripting question

2007-01-03 Thread Kevin Downey
On 1/3/07, Bill Moran <[EMAIL PROTECTED]> wrote: In response to Robert Huff <[EMAIL PROTECTED]>: > > This is probably staring me in the face: > > if [ ! -d "foo"] > then mkdir foo > fi > > gives me: > > [: missing ] > > Looking at rc.subr I see: > > if [ ! -d "$linkdir" ]

Re: OT: stupid sh scripting question

2007-01-03 Thread Chuck Swiger
On Jan 3, 2007, at 3:07 PM, Robert Huff wrote: if [ ! -d "foo"] then mkdir foo fi You want a space before the "]" and a semicolon after it. -- -Chuck ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/fr

Re: OT: stupid sh scripting question

2007-01-03 Thread Bill Moran
In response to Robert Huff <[EMAIL PROTECTED]>: > > This is probably staring me in the face: > > if [ ! -d "foo"] > then mkdir foo > fi > > gives me: > > [: missing ] > > Looking at rc.subr I see: > > if [ ! -d "$linkdir" ]; then >warn "$_me: the director