sed 's;pub/test/aaa.txt;d' file
sed命令的s后面第一个字符就是分隔符,分隔符跟你说的特殊字符不一样就可以了。
正确的如下:
#! /bin/sh
echo "Please input string:\c"
read str
a=`expr length $str`
a=`expr $a - 2`
str=`expr substr $str $a 3`
echo "the last three characters is: $str"