Whitespace in dir names (bash script problem)
- From: Mike <Not@xxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 23:15:04 GMT
The line...
target_dir="/mount/MP3 Player"
barfs (all references) with a "binary operator expected" (it reads the
MP3 bit, then treats the whitespace as a lead to a parameter, or
something?)
The best info I could dig up says that escaping the whitespace with a
backslash is the way to go here, but...
target_dir="/mount/MP3\ Player"
target_dir="/mount/MP3 \Player"
target_dir="/mount/MP3\Player" (This reads as "MP3Player")
....all barf too.
For practice, I've been doing...
ls /mount/MP3 Player (no such file or directory)
ls /mount/MP3\ Player (no such file or directory)
....and so on, as this generates the same problem a little easier than
constantly hacking the script.
Anybody got a clue on how to get a bash script variable to read a dir
name with whitespace in it? As the automounter assigns this troublesome
name, I think I'm stuck with it for now. :(
--
*===( http://principiadiscordia.com/
*===( http://www.badphorm.co.uk/
*===( http://www.zenwalk.org/
.
- Follow-Ups:
- Re: Whitespace in dir names (bash script problem)
- From: Unruh
- Re: Whitespace in dir names (bash script problem)
- From: noi ance
- Re: Whitespace in dir names (bash script problem)
- From: David W. Hodgins
- Re: Whitespace in dir names (bash script problem)
- From: Chris F.A. Johnson
- Re: Whitespace in dir names (bash script problem)
- Prev by Date: nfs
- Next by Date: Re: nfs
- Previous by thread: nfs
- Next by thread: Re: Whitespace in dir names (bash script problem)
- Index(es):
Relevant Pages
|