aliasconv.sh

来自「android-w.song.android.widget」· Shell 代码 · 共 43 行

SH
43
字号
#! /bin/bash## aliasconv.sh - convert csh aliases to bash aliases and functions## usage: aliasconv.sh## Chet Ramey# chet@po.cwru.edu#trap 'rm -f $TMPFILE' 0 1 2 3 6 15TMPFILE=$(mktemp -t cb.XXXXXX) || exit 1T='	'cat << \EOF >$TMPFILEmkalias (){	case $2 in	'')	echo alias ${1}="''" ;;	*[#\!]*)		comm=`echo $2 | sed  's/\\!\*/"$\@"/g				      s/\\!:\([1-9]\)/"$\1"/g			              s/#/\#/g'`		echo $1 \(\) "{" command "$comm"  "; }"		;;	*)	echo alias ${1}=\'`echo "${2}" | sed "s:':'\\\\\\\\'':"`\' ;;	esac}EOF# 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 mkaliassed -e "s:':\\'\\\'\\':" -e "s/^\([a-zA-Z0-9_-]*\)$T\(.*\)$/mkalias \1 '\2'/" >>$TMPFILEsh $TMPFILE | sed -e 's/\$cwd/\$PWD/g' \		     -e 's/\$term/\$TERM/g' \		     -e 's/\$home/\$HOME/g' \		     -e 's/\$user/\$USER/g' \		     -e 's/\$prompt/\$PS1/g'exit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?