2
line="premon D0000070 0x201 0x40" # it has 26 chars
echo $line | wc -C# giving out put 27 chars.
我想删除字符串中的额外字符..请帮忙吗?在shell脚本中删除字符串中的额外字符
line="premon D0000070 0x201 0x40" # it has 26 chars
echo $line | wc -C# giving out put 27 chars.
我想删除字符串中的额外字符..请帮忙吗?在shell脚本中删除字符串中的额外字符
实际上,您的字符串中没有额外的字符。 echo
在行尾放置'\ n'。如果你不想回显字符,你可以,如果你喜欢这种答案做
echo -n $line | wc -c
感谢您的rwply .. –
@SamitKumarPatra,你可以标记这是一个回答你的问题。 – banuj
FILE1.TXT premon D0000070 0x201 0x40的 script.sh CommandFileName = $ 1 同时读取线 ./script.sh FILE1.TXT //将它读换行字符呢? –