mirror of
https://github.com/cheat/cheat.git
synced 2024-11-25 23:41:36 +01:00
Removed cat
Piping cat to sed is an extra step. Sed can handle file arguments.
This commit is contained in:
parent
16244be4ea
commit
93bda9dc20
@ -10,5 +10,5 @@ echo 'It is daytime' | sed 's/day/night/g'
|
|||||||
# To remove leading spaces
|
# To remove leading spaces
|
||||||
sed -i -r 's/^\s+//g' file.txt
|
sed -i -r 's/^\s+//g' file.txt
|
||||||
|
|
||||||
# To remove empty lines
|
# Remove empty lines and print results to stdout:
|
||||||
cat file.txt | sed '/^$/d'
|
sed '/^$/d' file.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user