mkdir: recursive alternative?
Verde Denim
tdldev at gmail.com
Thu Jul 17 19:21:10 UTC 2008
On Thu, Jul 17, 2008 at 2:56 PM, Robert Dailey <rcdailey at gmail.com> wrote:
> Hi,
>
> I'm trying to use mkdir to create something like:
>
> /foo/blah/bar/something
>
> However, 'foo', 'blah', and 'bar' are not guaranteed to exist, so I
> need mkdir to recursively create the directories that are not there.
> Is there a way to do this? I did a lot of searching on google but I
> came up with nothing. Thanks.
if the path is known, something like
for $word in foo blah bar something
do
if [! -d $word]
mkdir $word
fi
done
(simple bash script)
Jack
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080717/c70988f1/attachment.html>
More information about the ubuntu-users
mailing list