James B. Byrne
2014-Jun-05 13:18 UTC
[CentOS] [SOLVED] [OT] OSX-10.9.3 cd ~'/ problem with spaces'
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
Lars Hecking
2014-Jun-05 13:38 UTC
[CentOS] [SOLVED] [OT] OSX-10.9.3 cd ~'/ problem with spaces'
> 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] $
Reasonably Related Threads
- [OT] OSX-10.9.3 cd ~'/ problem with spaces'
- "error in rsync protocol data stream (code 12) at io.c(150)" revisited
- Re: Install Red Hat AS 4 from iLO on a HP DL380?
- chattr +T not implemented?
- Forbidden: You don't have permission to access /phpMyAdmin/ on this server.