This is the mail archive of the cygwin@cygwin.com 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


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 to
> script these things yourself.

Thanks, Randall.  I learned about cygpath and got
so excited that I never bothered reading the rest
of the cyg* functions.  It was good Perl
experience, but I basically rewrote a small bit of
cygstart.

Learning about cygstart is like getting to open a
Christmas present early!  Time to go through and
mothball some scripts and update my aliases!

And, thanks to Lassi and Ehud for their followups.
Lassi suggested zsh, but I'm currently mostly
happy with bash and switching to zsh might help
tab completion but lose something else (vi editing
and history search?)

Ehud suggested:
cd ()
{
    builtin cd "$1"
    builtin cd `pwd -P`
}
to overcome the fact that I'm now in ~/pf or
whatever symlink.  Unfortunately, this didn't work
since `pwd -P` returns a path with spaces, and
we're back to square one.  (And as a minor
nitpick, it would mess up the use of "cd -" which
I find handy.)

In general though, defining function wrappers
rather than aliases is a good idea.  I still don't
think of doing this, so I appreciate the reminder.

I still don't have a "perfect" solution, but I've
now got a lot of tools to play with and many
good-enough solutions to choose from.  Again, many
thanks for everyone's help.

Best, James


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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