23,118
社区成员
发帖
与我相关
我的任务
分享
[nicenight@CSDN ~]$ a="ab/c"
[nicenight@CSDN ~]$ echo "pppoe_username=aaa" | sed "/pppoe_username/ s/=.*/=$a/g"
sed: -e expression #1, char 28: unknown option to `s'
[nicenight@CSDN ~]$ echo "pppoe_username=aaa" | sed "/pppoe_username/ s#=.*#=$a#g"
pppoe_username=ab/c
sed "/pppoe_username/ s#=.*#=$1#g"