Nice trick just using echo command:
$ str=" a string "
$ echo "[$str]"
[ a string ]
$ new=$(echo $str)
$ echo "[$new]"
[a string]
To trim an entire file:
sed 's/^[ \t]*//;s/[ \t]*$//' < input_file
Nice trick just using echo command:
$ str=" a string "
$ echo "[$str]"
[ a string ]
$ new=$(echo $str)
$ echo "[$new]"
[a string]
To trim an entire file:
sed 's/^[ \t]*//;s/[ \t]*$//' < input_file
For further actions, you may consider blocking this person and/or reporting abuse
Kumar Anirudha -
SameX -
SameX -
SameX -
Top comments (0)