Commit 181a2ed5 authored by Matt Cable's avatar Matt Cable
Browse files

Escape some metachars that trip up .zdirstore script

parent 21e2a913
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
# Run dirpersiststore in ~/.zlogout # Run dirpersiststore in ~/.zlogout
dirpersiststore () { dirpersiststore () {
# FIXME: need to escape all shell metacharacters, not just spaces! dirs -p | tail -r | perl -ne 'chomp;s/([& ])/\\$1/g ;print "if [ -d $_ ]; then pushd -q $_; fi\n"' > ~/.zdirstore
dirs -p | sed 's/ /\\ /g;s/&/\\&/;s/^/pushd -q /;1!G;h;$!d;' > ~/.zdirstore
} }
dirpersistrestore () { dirpersistrestore () {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment