Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why doesn't cd ignore files when you type say "cd fred*"
- X-seq: zsh-users 6839
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Why doesn't cd ignore files when you type say "cd fred*"
- Date: Thu, 4 Dec 2003 17:30:57 +0000
- In-reply-to: <kohusvg6jgqkqqtbc5th8h12b61iomo1gr@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kohusvg6jgqkqqtbc5th8h12b61iomo1gr@xxxxxxx>
On Dec 4, 2:54pm, zzapper wrote:
}
} Why doesn't cd ignore files when you type say "cd fred*" and there
} exists a file frederick.txt and a directory frederick ??
}
} I guess it's becauses the FNG handling fred* doesn't know that it's
} output is to be passed to cd .
Congratulations, you win a no-prize for accurate guessing.
} But can clever zsh be configued to avoid this behaviour.
You could always use a wrapper like this:
function cd {
local -a dirs
dirs=( "${^@}"(-/N) )
if (( $#dirs == 1 ))
then builtin cd $dirs
else builtin cd "$@"
fi
}
However, that might sometimes foil use of the two-argument form of "cd".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author