From b72432fdcc59300c6fe7c9d6c8a31ad3447933f5 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Fri, 19 Feb 1999 17:11:39 +0000 Subject: Imported from ../bash-2.03.tar.gz. --- examples/misc/aliasconv.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'examples/misc/aliasconv.sh') diff --git a/examples/misc/aliasconv.sh b/examples/misc/aliasconv.sh index 4cbebfb..29e1ead 100755 --- a/examples/misc/aliasconv.sh +++ b/examples/misc/aliasconv.sh @@ -1,8 +1,8 @@ #! /bin/bash # -# alias-conv.sh - convert csh aliases to bash aliases and functions +# aliasconv.sh - convert csh aliases to bash aliases and functions # -# usage: alias-conv.sh +# usage: aliasconv.sh # # Chet Ramey # chet@po.cwru.edu @@ -27,7 +27,11 @@ mkalias () } EOF -sed "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 +# the first thing we want to do is to protect single quotes in the alias, +# since they whole thing is going to be surrounded by single quotes when +# passed to mkalias + +sed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp/cb$$.1 sh /tmp/cb$$.1 | sed -e 's/\$cwd/\$PWD/g' \ -e 's/\$term/\$TERM/g' \ -- cgit v1.2.3