Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Stopping functions breaking



Hi

I'm writing a function (see below) which I call such

> pub fred

I want it to cd to any directory beginning fred, if there 0 or more
than 1 matches I wish to carry on in the script.

However whatever I try 0 or no matches breaks the script.

HELP PLEASE

function pub
{
if [ $# -gt 0 ];
then
   echo $?
   builtin chdir $1* &> /dev/null
   echo $?
zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips



Messages sorted by: Reverse Date, Date, Thread, Author