FAQ
I get the digest version fo this list so I apologise for any discontinuity to
my reply posts introduced thereby.

On Wed, June 4, 2014 15:36, Herta Van den Eynde wrote:
No OSX here either, but just to be sure, could you publish the results of:

which cd; echo $?
locate cd | grep '/cd'$; echo $?
ls -ldb ~/Library/Application*

$(which cd) returns /usr/bin/cd and that file contains the script I displayed
yesterday. I do not have my MBP here at work today so I cannot obtain the
other informations you desire.


In any case, once the reference to aliases twigged my memory I tested for the
problem with other accounts and discovered that the issue existed only for my
development user id. That brought to mind that I once had RVM installed on
that account. Further, I recalled I once had run into a bug with an early
development version of RVM due to it overriding cd in a shell function, which
is not an alias but is similar enough for most purposes. I cannot recall what
that issue was but at least the memory of it put me on the right track.


So I grepped for CD in ~/\.* and found an RVM related cd function in
.bash_profile which did not escape $1. I changed that reference to "$1" and
the problem was thereby fixed.


Thanks for all the help and suggestions.


I do have a few residual questions however:


1. What does the 1+ in the shell expansion ${1+"$@"} mean and do?


2. I know that $0 returns the shell name or shell script file name. How does
${0##*/} differ in effect from $0.


3. Why is ${0##*/} used instead of $0 or ${0} in this case?






--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3

Search Discussions

  • Lars Hecking at Jun 5, 2014 at 1:38 pm
    1. What does the 1+ in the shell expansion ${1+"$@"} mean and do?

      http://unix.stackexchange.com/questions/68484/what-does-1-mean-in-a-shell-script-and-how-does-it-differ-from

    2. I know that $0 returns the shell name or shell script file name. How does
    ${0##*/} differ in effect from $0.

      It strips a leading path. $0 is the shell/script exactly as it was invoked.


    $ pwd
    /home/user
    $ ../../bin/bash
    [bash] $ echo $0
    ../../bin/bash
    [bash] $ echo ${0##*/}
    bash
    [bash] $

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedJun 5, '14 at 1:18p
activeJun 5, '14 at 1:38p
posts2
users2
websitecentos.org
irc#centos

2 users in discussion

James B. Byrne: 1 post Lars Hecking: 1 post

People

Translate

site design / logo © 2021 Grokbase