]>
git.ipfire.org Git - thirdparty/bash.git/blob - examples/misc/aliasconv.bash
3 # alias-conv.sh - convert csh aliases to bash aliases and functions
10 trap 'rm -f /tmp/cb$$.?' 0 1 2 3 6 15
14 cat << \EOF
>/tmp
/cb$$
.1
17 if [ "x$2" = "x" ]; then
19 elif echo "$2" |
egrep -s '(\!|#)' >/dev
/null
2>&1; then
20 comm=$
(echo $2 |
sed 's/\!\*/"$\@"/g
21 s/\!:\([1-9]\)/"$\1"/g
23 echo $1 \
(\
) "{" command "$comm" "; }"
25 echo alias ${1}=\'$
(echo "${2}" |
sed "s:':'\\\\'':")\'
30 sed "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>/tmp
/cb$$
.1
32 $BASH /tmp
/cb$$
.1 |
sed -e 's/\$cwd/\$PWD/g' \
33 -e 's/\$term/\$TERM/g' \
34 -e 's/\$home/\$HOME/g' \
35 -e 's/\$user/\$USER/g' \
36 -e 's/\$prompt/\$PS1/g'