summaryrefslogtreecommitdiffstats
path: root/Misc/c2z
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
commit876fa2c44e0a17b2d10a2547ac1d13687cfed520 (patch)
treef92ce7475c97f82a05e20e9ba8be9b83436c9b6b /Misc/c2z
parentunposted: force latest aclocal.m4 from vendor to the main branch (diff)
downloadzsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.gz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.bz2
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.lz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.xz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.zst
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.zip
unposted: force latest version of files from vendor to main branch
Diffstat (limited to 'Misc/c2z')
-rwxr-xr-xMisc/c2z10
1 files changed, 9 insertions, 1 deletions
diff --git a/Misc/c2z b/Misc/c2z
index 8a90d5fd8..534137296 100755
--- a/Misc/c2z
+++ b/Misc/c2z
@@ -3,6 +3,7 @@
# c2z - environment conversion tool
# Contributed by Bart Schaefer
# (Tweaked a bit by Paul Falstad)
+# (Tweaked again by Bart Schaefer)
#
# This is a quick script to convert csh aliases to zsh aliases/functions.
# It also converts the csh environment and local variables to zsh. c2z
@@ -81,7 +82,13 @@ grep -v ! /tmp/cz$$.1 >/tmp/cz$$.3
sed -e "s/'/'"\\\\"''"/g \
-e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/alias -- \1='"'\2'/" \
/tmp/cz$$.3
-sed -e 's/![:#]*/$/g' \
+sed -e 's/>\(&*\)!/>\1|/g' \
+ -e 's/!\*:q/"$@"/g' \
+ -e 's/\(![:#]*[^'"$T"']*\):q/"\1"/g' \
+ -e 's/!\([-0-9][0-9]*\)\(:x\)*/$\2(fc -nl \1)/g' \
+ -e 's/\$:x(fc/$=(fc/g' \
+ -e 's/![:#]*\([^'"$T"']\)/$==\1/g' \
+ -e 's/\$=\(=[^'"$T"']*\):x/$\1/g' \
-e 's/\$cwd/$PWD/' \
-e 's/^\([^'"$T"']*\)'"$T"'\(.*\)$/\1 () { \2 }/' \
/tmp/cz$$.2
@@ -92,6 +99,7 @@ exec < /tmp/cz$$.e
# Would be nice to deal with embedded newlines, e.g. in TERMCAP, but ...
sed -e '/^SHLVL/d' \
-e '/^PWD/d' \
+ -e '/^_=/d' \
-e "s/'/'"\\\\"''"/g \
-e "s/^\([A-Za-z0-9_]*=\)/export \1'/" \
-e "s/$/'/"