Re: OT: Need help from bash experts...
On Mon, 11 Feb 2002 21:22:06 -0500
Neal Lippman <nl@lippman.org> wrote:
[snip]
> I have tried all sorts of variants:
> sourcedir="/mount/windows/spaced\ name"
> sourcedir="/mount/windows/spaced\\ name"
> sourcedir=/mount/windows/spaced\\ name"
me@rebel:~$ cat tst.sh
#!/bin/sh
d="foo bar"
cd "$d" # <---- note the quotes
pwd
me@rebel:~$ ./tst.sh
/home/me/foo bar
The issue is that without the quotes around $d, bash thinks that
d contains a list of words. This is a very handy programming
feature in many cases, but one where you have to work around here.
--
+------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@cox.net |
| Jefferson, LA USA http://ronandheather.dhs.org:81 |
| |
| 484,246 sq mi are needed for 6 billion people to live, 4 !
! persons per lot, in lots that are 60'x150'. |
! That is ~ California, Texas and Missouri. !
! Alternatively, France, Spain and The United Kingdom. |
+------------------------------------------------------------+
Reply to: