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

Re: making `cd` work unquoted



On Jul 25,  9:10am, spiralofhope wrote:
}
} I'm trying to make a function which will accept this:
}   cd foo bar baz
} and have it acted upon as:
}   cd "foo bar baz"
} 
} So far, I've run into a few snags.
} 
} I don't see how I can make a 'cd' function which will refer to the
} 'cd' builtin.  Not a big deal, I could call the function 'ccd'.

cd() { builtin cd "$*" }

} I can't do something simple like cd "$@"

"$@" is the same as "$1" "$2" "$3" ...

"$*" is the same as "$1 $2 $3 ..."

(note placement of quotes)

You should probably find a book on basic shell programming and learn
the elements of shell language behavior before you try to dive in
with the zsh manual.  It's not written as a tutorial, and the zsh
tutorials that exist assume knowledge of the basics.



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