Linux Strip White Space

[Solved] Linux Strip White Space | Perl - Code Explorer | yomemimo.com
Question : shell strip white space

Answered by : charlesalexandre-roy

# Basic syntax:
sed 's/^ *//g'
# Example usage:
echo ' text' # Printing without sed command
--> text
echo ' text' | sed 's/^ *//g' # Pipe to sed command
--> text
# Note, use the following to remove all whitespace from the end of every line
sed 's/ *$//g'

Source : https://linuxhint.com/trim_string_bash/#:~:text=Use%20sed%20's%2F%5E%20*%2F%2F,command%20and%20%5B%5B%3Aspace%3A%5D%5D.&text=%24%20echo%20%22%24Var%20are%20very%20popular%20now.%22 | Last Update : Mon, 05 Oct 20

Answers related to linux strip white space

Code Explorer Popular Question For Perl