Reputation
1,482
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
9 16
Newest
 Yearling
Impact
~280k people reached

Aug
20
comment tee results in a null file
@Rinzwind: right :-)
Aug
20
answered tee results in a null file
Aug
20
comment tee results in a null file
You are referencing the same file twice in the pipeline, tee will overwrite the file before awk gets to it. Either use a temporary file or use sponge from moreutils. If you are using a recent version of GNU awk, it has an -i inplace argument
Jun
25
comment Resuming a vim session I have accidentally Disconnected from
@PeterV.Mørch: Me too, that's how I found reptyr :-)
Jun
25
comment Resuming a vim session I have accidentally Disconnected from
@PeterV.Mørch: If this is a regular problem, you should consider running your programs within tmux or GNU screen.
Jun
15
awarded  Yearling
May
24
awarded  Enlightened
May
23
awarded  Nice Answer
Apr
13
comment Edit text iteratively within a file using commands
@EliahKagan: Yes, but it is not pretty, besides according to the OPs comment, it seems the white-space is there due to a formatting error. Anyway, if you really wanted to accommodate white-space at the beginning, something like this would work: file=infile; paste -d '' <(sed -r 's/^(\s*).*/\1/' $file) <(sed -r 's/^\s*//' $file | awk '{ORS=RT; print NR":"$0}' RS='[ \n]+').
Apr
13
comment Edit text iteratively within a file using commands
@YUVRAJ: write it to a temporary file and overwrite the original after, as suggested by John1024.
Apr
12
answered Edit text iteratively within a file using commands
Mar
5
answered awk: matching strings to decimal values and summing them
Mar
3
revised Remove all text before last space in text file from CLI
added awk example
Mar
2
answered Remove all text before last space in text file from CLI
Feb
26
revised How to stock all files with the same suffix into a table?
added 107 characters in body
Feb
26
revised How to stock all files with the same suffix into a table?
Added references for find print0 comment
Feb
26
comment How to stock all files with the same suffix into a table?
@muru: I have not seen that one before. Good to know, thanks.
Feb
26
answered How to stock all files with the same suffix into a table?
Feb
18
answered Grep strings in a subgroup of lines in txt file
Sep
30
awarded  Explainer