* argc f() { echo "$# args" } func() { f "$*" f "$@" } func a b c # sh argc.sh 1 args 3 args
* rmdir link # ln -s 090903-215949 latest # ls 090903-215949 latest # rm latest/ rm: cannot remove directory `latest/': Is a directory # rm -rf latest/ rm: cannot remove `latest/':Not a directory
* sed 1,只输出,不保存: [root@RHEL5GA ~]# PDES="[tcsh] fix a manual bug about 'Pmode:'" [root@RHEL5GA ~]# echo "${PDES}"| sed "s/'/\\\'/g" [tcsh] fix a manual bug about \'Pmode:\'
使用3个,\\\
2,如果要保存为变量: PDES="[tcsh] fix a manual bug about 'Pmode:'" echo "${PDES}" PDES=`echo "${PDES}" | sed "s/'/\\\\\