Reputation: 31
line="premon D0000070 0x201 0x40" # it has 26 chars
echo $line | wc -c # giving out put 27 chars.
i want to remove the extra char in the string.. please help?
Upvotes: 2
Views: 127
Reputation: 3230
Actually you don't have an extra char in your string.
echo
puts a '\n' at the end of line. If you don't want to echo that char, you can do
echo -n $line | wc -c
Upvotes: 4