Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
making `cd` work unquoted
- X-seq: zsh-users 14256
- From: spiralofhope <spiralofhope@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: making `cd` work unquoted
- Date: Sat, 25 Jul 2009 09:10:08 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type :content-transfer-encoding; bh=GCcTMO9gyKSLJhlBEtJXBxF0j51bWmKBTipq80/nsMI=; b=pJol0pHdkbn5wdn9+h+aOjJ8DKze9g7QCVNK9vPfTLpES1U2yeFl+UysO9Ue49TJhw f6ZwuFBjJ0/Qa0idv50oloNYAFxKJzgLf6tZnc3F2e+zm5qATj5NPFIjuK84YaRc36Wq 97+AwPoOhLXVhrWtaeVkJnzSOCAd+fdR6tpUU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type :content-transfer-encoding; b=rH3yOlvb3rlLXKgb806DAsUXhQAbzB57PhSZ4vPlrVmYZvx/EYU1pDQu7BFUk/BEUP D2wXRlnC/o+KEuisEy3IcAz76Hd9zc/0X4c/+dh0NjczNahivASoqRQjjyfwIe/dAzvV hfXxXPVdGlGzwma8mbzNDNfLbFH5YWFP5gJfg=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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'.
I can't do something simple like cd "$@"
Quoting with backslashes, like ${(q)@} or single/double quotes isn't
working either. Tildes in the path name are mucking things up.
I tried doing a search-and-replace like so
var1=${@:gs/ /\\\\ /}
var2=${var1:gs/~/\\\\~/}
cd "$var2"
but that's not working either.. which is rather confusing because it
feels like it should.
I went looking for a way to temporarily disable expansion of the
tilde. I figure this is the best route to go at this point. But after
doing a bunch of searching I haven't found a way. I must be using the
wrong terms to look..
Does anyone have any hints on how I could implement this?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author