On Tuesday 28 October 2008 02:28:16 pm Ken Irving wrote:
>On Tue, Oct 28, 2008 at 01:57:40PM -0500, Kent West wrote:
>> Ken Irving wrote:
>> > echo -e "YES, '$targetDir exists!\n\n"
>>
>> Ah, the "-e" enables things like newlines and the bell character.
>
>I use it a lot (but I think ju
On Tue, Oct 28, 2008 at 01:57:40PM -0500, Kent West wrote:
> Ken Irving wrote:
> ...
> > I'd tend to format the above code a little differently, but here's
> > the same thing with the `if' using the mkdir command directly:
> >
> > if [ -d $targetDir ]; then
> > echo -e "YES, '$targe
Ken Irving wrote:
> The [ ... ] construct isn't needed for a command like mkdir, just
> for conditional tests of variables and strings (see CONDITIONAL
> EXPRESSIONS in bash(1)).
>
Ah, beginning to coalesce in my brain now.
> I'd tend to format the above code a little differently, but here's
>
Kent West wrote:
> Chris Jones wrote:
>
>> if mkdir; then
>> echo 'created OK'
>> else
>> echo 'not created OK'
>> exit 1
>>
>>
>> ... the [] is redundant, IOW:
>>
>> if test mkdir# ???
>>
>> also your sample has the then/else actions inverted.
>>
>>
>
> T
On Tue, Oct 28, 2008 at 11:42:09AM -0500, Kent West wrote:
> ===
>
> echo "Does target directory '$targetDir' exist?"
> if [ -d $targetDir ]
> then
> echo "YES, '$targetDir exists!"
> echo
> else
> echo "No, '$targetDir' does not exis
Chris Jones wrote:
> if mkdir; then
> echo 'created OK'
> else
> echo 'not created OK'
> exit 1
>
>
> ... the [] is redundant, IOW:
>
> if test mkdir # ???
>
> also your sample has the then/else actions inverted.
>
Thank you. I thought I had tried it without t
On Tue Oct 28, 2008 at 11:42:09 -0500, Kent West wrote:
> if [ mkdir -p $targetDir ] # If the mkdir fails
Use:
if ( mkdir -p $targetDir )
Steve
--
http://www.steve.org.uk/
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Co
Hey all!
After a couple of hours of searching, I've decided that both my
scripting-foo and my google-foo are weak this morning, so I turn to you
folks for a quick answer.
In a bash script, I'm trying to create a directory and test if it is
successful.
The man page doesn't indicate what mkdir ret
8 matches
Mail list logo