1
0
Fork 0

Escape some metachars that trip up .zdirstore script

pull/1/merge
Matt Cable 15 years ago
parent 21e2a913bf
commit 181a2ed537

@ -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 () {

Loading…
Cancel
Save