What's up with bash shell and spaces in filenames? [SOLVED]

Alan Evans ame.fedora at gmail.com
Mon May 10 16:42:45 UTC 2010


On Mon, May 10, 2010 at 9:28 AM, Tom Horsley <horsley1953 at gmail.com> wrote:
> Then try putting the cd command in single quotes as well - it may be
> some alias that isn't dealing correctly with escaped args.

Somebody just sent me a private reply along these same lines. Here is
my reply to him (I thought I was replying to the list):

cd is not aliased. But that got me thinking...

cd *is* redefined in my .bashrc file. I totally forgot about that; I
did it years ago. Comment out the redefinition and: Hurray! Thanks for
that! It's been a thorn in my side for a very long time.

For those curious about why I would redefine cd, I think it was
because I wanted to auto-execute scripts when I entered certain
directories:

cd ()
{
       builtin cd $1 || return
       [[ -f ./.autorun ]] && . ./.autorun
}

Now I guess that won't work. Oh well, that's a smaller problem. It was
really a silly solution to a non-problem anyway. Although now I'm
curious if there's a way to fix the function. Could $1 be replaced by
anything that might work?


More information about the users mailing list