diff options
Diffstat (limited to 'examples/misc/aliasconv.sh')
-rwxr-xr-x | examples/misc/aliasconv.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/misc/aliasconv.sh b/examples/misc/aliasconv.sh index 29e1ead..75db077 100755 --- a/examples/misc/aliasconv.sh +++ b/examples/misc/aliasconv.sh @@ -14,16 +14,16 @@ T=' ' cat << \EOF >/tmp/cb$$.1 mkalias () { - if [ "x$2" = "x" ]; then - echo alias ${1}="''" - elif echo "$2" | egrep -s '(\!|#)' >/dev/null 2>&1; then + case $2 in + '') echo alias ${1}="''" ;; + *[#\!]*) comm=`echo $2 | sed 's/\\!\*/"$\@"/g s/\\!:\([1-9]\)/"$\1"/g s/#/\#/g'` echo $1 \(\) "{" command "$comm" "; }" - else - echo alias ${1}=\'`echo "${2}" | sed "s:':'\\\\\\\\'':"`\' - fi + ;; + *) echo alias ${1}=\'`echo "${2}" | sed "s:':'\\\\\\\\'':"`\' ;; + esac } EOF |