Skip to content

Commit 19e1227

Browse files
committed
simplified code since we have one space per line
1 parent 25db0ac commit 19e1227

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

individual-shell-tools/sed/script-05.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ set -euo pipefail
66
# If a line starts with a number and a space, make the line instead end with a space and the number.
77
# So line 6 which currently reads "37 Alisha" should instead read "Alisha 37".
88
# The output should contain 11 lines.
9-
sed -E "s/^[[:space:]]*([0-9]+)[[:space:]]+(.*)$/\2 \1/" input.txt
9+
sed -E "s/^([0-9]+) (.*)$/\2 \1/" input.txt
1010

0 commit comments

Comments
 (0)