This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bash puzzle: Spaces, environment variables and tab completion


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/G<tab completion!>
> >
> (...)
> >
> > So, I ask the list:
> >         Can you define $PF so that cd $PF;
> >         ls $PF/Games; and ls $PF/G<tab> all work???
> I'd do something like:
> % ln -s '/cygdrive/c/Program Files' /programs
> % PF=/programs
>   - Michael

$ mount 'c:\Program Files' /programs

Following this line of thinking, you could just change the name of that directory, as long as you found all the registry entries that mentioned it and changed them too. I think maybe Norton SystemWorks can do this sort of thing, though you may have to do it one app at a time.

Wouldn't the symlink approach suggested by Michael Schaap be a little less heavy-handed? I use it for drive directory aliases (e.g. "ln -s /cygdrive/c /c") and it works with completion. However, if you want to list that directory itself, you need to give "ls" the "-L" flag, but I have a set of aliases (using capital letters: "alias LS='ls -L'" or "alias LL='ls -lL'") to hand that not-too-common case.


Randall Schulz
Mountain View, CA USA

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]