about summary refs log tree commit diff
path: root/Misc/c2z
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:07:38 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:07:38 +0000
commitf13624e0f8a3c28c90aa0ce8ee36b639a491e4a9 (patch)
tree7ebc57c7b2ceed481e23f598011dc88d159c9178 /Misc/c2z
parenta61dc2074ae6cd00f1c166dc0102c491db056060 (diff)
downloadzsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.tar.gz
zsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.tar.xz
zsh-f13624e0f8a3c28c90aa0ce8ee36b639a491e4a9.zip
zsh-3.1.5-pws-2 zsh-3.1.5-pws-2
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/$/'/"