If I used:
It only removes the first occurrence. How can I remove all occurrence in the line?
Thanks & Regards
on 11/22/2010 – Made popular on 11/22/2010
With awk, I would need to trim a string from the beginning up to the first occurrence of "1", then from the beginning up to the second occurrence of "1", then from the beginning up to the third, then the fourth...., then the last occurrence of "1".
I have a very simple question, but I cannot figure out how to solve.
I have a simple string containing the carriage return or line feed at the end:
# echo $var
BLA BLA BLA
Now if I want to remove the CR I can use:
echo $var|tr -d '\n\r'
Because the $var should be reported on a file, togheter with other values, how can I remove the CR directly on the $var?