[ubuntu-uk] Bash and Path checks

Tony Arnold tony.arnold at manchester.ac.uk
Mon Apr 20 10:49:22 BST 2009


Cornelius,

Cornelius Mostert wrote:
>> Are you doing this to avoid the mkdir if the directory you are creating
>> already exists? If so, then the is an option -p which means it is not an
>> error if the directory already exists. It also creates parent
>> directories as needed, so:
>>
>>       mkdir -p $newPath/Sound/MP3
>>       mkdir -o $newpath/Sound/wav

Oops! That last line should read:

	mkdir -p $newPath/Sound/wav

>> will do what you want without the need to test.
>> (BTW, it's forward slashes / in Linux, not backslahes!)
>> Of course, I may have misunderstood what you are trying to achieve.
>>
>> Regards,
>> Tony.
> 
> Thanx I will try the -p option.
> As I understand it the \ is to pipe whatever onto what is infront of
> the \ so it reads Get the Variable and Pipe the following onto it ...

You were using it as a separator in a path to separate the various
directory names. In Linux/Unix that should be a forward slash (/).
Windows uses the backslash (\) for such purposes.

As others have pointed out, pipes are something else.

> You have understood my question...

Oh good! I was worried I had missed something!

Regards,
Tony.
-- 
Tony Arnold,                        Tel: +44 (0) 161 275 6093
Head of IT Security,                Fax: +44 (0) 870 136 1004
University of Manchester,           Mob: +44 (0) 773 330 0039
Manchester M13 9PL.                 Email: tony.arnold at manchester.ac.uk



More information about the ubuntu-uk mailing list