James,
You're swimming upstream. Don't do that. Use the system in accordance with
its design.
Parsing command lines based on white-space separators fundamentally entails
the need for escaping or quoting when those separator characters are to be
included in the arguments and not used to separat
[snip $PF is a path with spaces]
> So, I ask the list:
> Can you define $PF so that cd $PF;
> ls $PF/Games; and ls $PF/G all work???
Yep: use single-quotes ('), not double ("). And ask not why; there are none
alive who understand the seemingly random shell quoting rules.
Note al
> James,
>
> You're swimming upstream. Don't do that. Use the system in accordance with
> its design.
>
Don't listen to him Jim! You pound anything long enough, it'll give!
> Parsing command lines based on white-space separators fundamentally entails
> the need for escaping or quoting when those
>
> What I want to do is define an environment
> variable so I can easily cd or ls. E.g.
> % PF="/cygdrive/c/Program Files"
> % cd $PF
> % ls $PF/Games
> % ls $PF/G
>
> The above is close, I can
> % cd "$PF"; ls "$PF"/Games; and even
> ls "$PF"/G however, the quotes are clunky.
That's the bash
On 4-12-2002 7:09, James Shaw wrote:
(...)
What I want to do is define an environment
variable so I can easily cd or ls. E.g.
% PF="/cygdrive/c/Program Files"
% cd $PF
% ls $PF/Games
% ls $PF/G
(...)
So, I ask the list:
Can you define $PF so that cd $PF;
ls $PF/Games; and ls $
At 23:23 2002-12-03, Gary R. Van Sickle wrote:
> James,
>
> You're swimming upstream. Don't do that. Use the system in accordance with
> its design.
>
Don't listen to him Jim! You pound anything long enough, it'll give!
Ordinarily, I agree, but on this point, you'd have to re-write the shell's
On Wed, 4 Dec 2002, Michael Schaap wrote:
> On 4-12-2002 7:09, James Shaw wrote:
> (...)
> > What I want to do is define an environment
> > variable so I can easily cd or ls. E.g.
> > % PF="/cygdrive/c/Program Files"
> > % cd $PF
> > % ls $PF/Games
> > % ls $PF/G
> >
> (...)
> >
> > So, I ask the
On 4-12-2002 17:17, Igor Pechtchanski wrote:
On Wed, 4 Dec 2002, Michael Schaap wrote:
On 4-12-2002 7:09, James Shaw wrote:
(...)
What I want to do is define an environment
variable so I can easily cd or ls. E.g.
% PF="/cygdrive/c/Program Files"
% cd $PF
% ls $PF/Games
% ls $PF/G
(...)
S
Igor,
At 08:17 2002-12-04, you wrote:
On Wed, 4 Dec 2002, Michael Schaap wrote:
> On 4-12-2002 7:09, James Shaw wrote:
> (...)
> > What I want to do is define an environment
> > variable so I can easily cd or ls. E.g.
> > % PF="/cygdrive/c/Program Files"
> > % cd $PF
> > % ls $PF/Games
> > % ls
Hi all,
Thanks to everyone for the advice.
The first posts of advice were that it wasn't
possible to do within the bash quoting mechanism:
"You're swimming upstream. Don't do that. Use the
system in accordance with its design."
I agree that I felt like I was swimming upstream.
Hence my post. I
James,
At 22:01 2002-12-04, James Shaw wrote:
Hi all,
Thanks to everyone for the advice.
The first posts of advice were that it wasn't possible to do within the
bash quoting mechanism:
"You're swimming upstream. Don't do that. Use the system in accordance
with its design."
I agree that I fe
> Although I appreciate Gary's encouragement, going
> around bash instead of struggling with it, does
> seem the better solution.
Well now, I never said you couldn't cheat a *little* ;-).
> There were several
> variations on the same theme on this bypass
> solution. Thanks to Ehud, Michael and
You might want to try with zsh, it's more flexible and convenient to use
than bash. I haven't used it on Windows, but here's a linux example:
$ mkdir -p '/tmp/foo/a bar'
$ F='/tmp/foo/a bar'
$ ls -ld $F
drwxr-xr-x2 lat zh 4096 Dec 5 11:26 /tmp/foo/a bar
$ touch $F/xyz
On Wed, 4 Dec 2002 22:01:04 -0800 (PST), James Shaw <[EMAIL PROTECTED]> wrote:
>
> One minus with this 'cheat' is that I don't get
> the 'real' name of the path. E.g. If I cd ~/pf,
> bash (correctly) thinks that I'm in /home/jhs/pf,
> but it would be nice to use the long name. If it
> was a hard
Hi everyone,
> PF=$(cygpath -u $(cygpath -d '/cygdrive/c/Program
Files'))
And we have a winner! Gary wins the December Bash
Hacking award. (Well, IMHO)
Clunky, yes with the DOS 8.3 names, but it is the
closest to solving the puzzle (without cheating).
> Learn about "cygstart" and you won't ha
15 matches
Mail list logo