delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/09/13:29:01

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: <5.1.0.14.2.20020809102600.02e7ee98@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Fri, 09 Aug 2002 10:30:08 -0700
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: cygwin and long filenames with spaces
In-Reply-To: <20020809171718.GA25546@butch.jgcomp.com>
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0208091209400 DOT 20358-100000 AT slinky DOT cs DOT nyu DOT edu>
<MPG DOT 17bdf8ff52c958ea989697 AT news DOT gmane DOT org>
<Pine DOT GSO DOT 4 DOT 44 DOT 0208091209400 DOT 20358-100000 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0

At 10:17 2002-08-09, Jon LaBadie wrote:
>On Fri, Aug 09, 2002 at 12:11:45PM -0400, Igor Pechtchanski wrote:
> > On Fri, 9 Aug 2002, Chris Game wrote:
> >
> > > In an earlier post, Randall R Schulz said...
> > >
> > > > It sounds like you have an alias or shell procedure standing in for the
> > > > built-in "cd" command.
> > >
> > > Ah! That vaguely rings a bell.
> > > <goes away and tries it>
> > > Yes, long ago in the days of beta 19.whatever I must have set cd up
> > > as a function including a 'pwd' line. The response is:
> > >
> > > cd is a function
> > > cd ()
> > > {
> > >     builtin cd $1;
> > >     pwd
> > > }
> > > cd is a shell builtin
> > >
> > > So - I need to modify the 'builtin ...' line.
> > >
> > > <tries a couple of possibilities>
> > >
> > > Well, 'builtin cd "$*";' works! No  idea if that's the correct
> > > modification though.
> > >
> > > Thanks for all the help - what  a group!
> >
> > I'd make that 'builtin cd "$@"' instead.  Not sure if it matters in the
> > case of cd, but this would make it treat quoted parameters properly...
> > Good practice, anyway. :-)
>
>Good practice for most scripts.  But it would make the two strings
>separate quoted arguments when the objective is to make them one.
>
>--
>Jon H. LaBadie


Jon,

Not quite. It means that the number of arguments seen by the built-in "cd" 
command will be identical to the number of arguments given in the top-level 
(interactive or scripted) invocation of the "cd" shell function.

Since the built-in "cd" command takes options (try "help cd"), the "$@" is 
advisable.

Usually "$@" is the right way to go, but there could be times when joining 
multiple arguments into a single string might be called for.

Randall Schulz
Mountain View, CA USA


--
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