shell中我需要拼接字符串,也就是得到下面的var2,但是总不成功,请指教! 5
d="$1"echo"$d"var=$(pwd)echo"var=$var"var1=${var%%$d*}echo"var1=$var1"var2=$var1$d#或者...
d="$1"
echo "$d"
var=$(pwd)
echo "var=$var"
var1=${var%%$d*}
echo "var1=$var1"
var2=$var1$d
#或者var2=${var1}${d}
echo "var2=$var2"
而我想得到的结果是:var2=/op3/****jie/ruanxiongfei,但输出结果是ruanxiongfeihoujie 展开
echo "$d"
var=$(pwd)
echo "var=$var"
var1=${var%%$d*}
echo "var1=$var1"
var2=$var1$d
#或者var2=${var1}${d}
echo "var2=$var2"
而我想得到的结果是:var2=/op3/****jie/ruanxiongfei,但输出结果是ruanxiongfeihoujie 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询