Seems like this should just remove at most 2 spaces from the start of each line: cat test.txt | 9 sed 's/^ //g
; instead it replaces all spaces from the start of the line. GNU's sed seems to be have as I'd expect here, for comparison, but I'm interested in learning the Plan 9 way.
Note: the 9 sed
syntax here is because I'm running it from plan9port.
In more detail:
$ cat test.txt
This
is
a test.
Bye
$ cat test.txt | 9 sed 's/^ //g'
This
is
a test.
Bye
I would expect that the output would be more like using GNU sed
:
$ cat test.txt | sed 's/^ //g'
This
is
a test.
Bye