mirror of
https://github.com/cheat/cheat.git
synced 2024-11-16 17:08:29 +01:00
cheat sed, remove leading spaces with regex
This commit is contained in:
parent
e6d5d9b8dc
commit
9500ca8446
1 changed files with 3 additions and 0 deletions
|
@ -6,3 +6,6 @@ sed -i 's/day/night/g' file.txt
|
||||||
|
|
||||||
# To replace all occurrences of "day" with "night" on stdin:
|
# To replace all occurrences of "day" with "night" on stdin:
|
||||||
echo 'It is daytime' | sed 's/day/night/g'
|
echo 'It is daytime' | sed 's/day/night/g'
|
||||||
|
|
||||||
|
# To remove leading spaces
|
||||||
|
sed -i -r 's/^\s+//g' file.txt
|
||||||
|
|
Loading…
Reference in a new issue