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
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 link,
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 have
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/Gtab completion!
The above is close, I can
% cd $PF; ls $PF/Games; and even
ls $PF/Gtab 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/Gtab completion!
(...)
So, I ask the list:
Can you define $PF so that cd $PF;
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/Gtab completion!
(...)
So, I ask the list:
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/Gtab
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 $PF/Gtab
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
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 Igor.
[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/Gtab 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
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
14 matches
Mail list logo