日期:2025-07-18 14:31:02 人气:1

    A+
热门评论

shell去掉字符串中的特定字符的方法是什么?

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"

阅读全文