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?
- 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-sc...
- 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] $