<quote who="Stuart Guthrie">

> Bug or feature:
> I'm wondering why the standard basename and dirname commands in gnu do 
> not handle spaces in file names and paths. I guess there is a good 
> reason why we need to code around it - ie it would break lots of other 
> stuff to fix it.

... it works for me. As always with names with spaces though, you need to
escape to prevent the shell parsing the string into separate arguments:

basename '/spacey tmp/test file.txt' .txt
test file
dirname '/spacey tmp/test file.txt'
/spacey tmp

> Question:
> Is there any /bin/sh script out there that handles this? Googling has so 
> far been fruitless.  Looks like I might have to bsh it.

Make sure your variable quoting is correct.

J.
-- 
Jan Schmidt                                  [EMAIL PROTECTED]

Open Source Software: Free as in Free Speech, not Free Beer
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to