delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/06/01:58:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20021206065752.27690.qmail@web13606.mail.yahoo.com>
Date: Thu, 5 Dec 2002 22:57:52 -0800 (PST)
From: James Shaw <qumqam AT yahoo DOT com>
Subject: Re: Bash puzzle: Spaces, environment variables and tab completion
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019