Can I make zsh expand tildes in double quotes?

6

2

Ever since I discovered you can use filename completion in double quotes, I've been using it for files with spaces in their names (like /Library/Application Support). It looks nicer and is easier to read than a path littered with backslashes. The problem is, there are also things in my home folder with spaces in their names (~/Library/Application Support, and I can't use quotes there because they escape tildes. Is there any way to turn that off?

Blacklight Shining

Posted 2013-04-27T16:56:14.180

Reputation: 2 127

Answers

3

I don't think so. The zsh user's guide simply says:

Double quotes allow some, but not all, forms of substitution inside. More specifically, they allow parameter expansion, command substitution and arithmetic substitution, but not any of the others: process substitution doesn't happen, braces and initial tildes and equals signs are not expanded and patterns are not special. Here's a table; each expression on the left is some command line argument, and the results show what is substituted if it appears outside quotes, or in double quotes.

Expression      Outside quotes  In double quotes
------------------------------------------------
...
~/foo           /home/pws/foo   ~/foo

kine

Posted 2013-04-27T16:56:14.180

Reputation: 1 669