Removed cat

Piping cat to sed is an extra step.  Sed can handle file arguments.
This commit is contained in:
adelviscio 2013-09-07 00:29:49 -04:00
parent 16244be4ea
commit 93bda9dc20

View File

@ -10,5 +10,5 @@ echo 'It is daytime' | sed 's/day/night/g'
# To remove leading spaces
sed -i -r 's/^\s+//g' file.txt
# To remove empty lines
cat file.txt | sed '/^$/d'
# Remove empty lines and print results to stdout:
sed '/^$/d' file.txt