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

Alan Evans ame.fedora at gmail.com
Mon May 10 17:04:05 UTC 2010


On Mon, May 10, 2010 at 9:56 AM, Chris Adams <cmadams at hiwaay.net> wrote:
> Once upon a time, Alan Evans <ame.fedora at gmail.com> said:
>> cd ()
>> {
>>        builtin cd $1 || return
>>        [[ -f ./.autorun ]] && . ./.autorun
>> }
>
> Any shell functions should properly quote their arguments (and there are
> possibly arguments to cd, so you should pass all args, not just the
> first).  So:
>
> cd ()
> {
>       builtin cd "$@" || return
>       [[ -f ./.autorun ]] && . ./.autorun
> }

Cool. Thanks!

(I always knew that my attempt was amateurish...)


More information about the users mailing list