Reputation
29,315
Next tag badge:
58/100 score
30/20 answers
Badges
1 35 69
Newest
 Nice Answer
Impact
~1.4m people reached

10h
answered How to loop through a file and make each line a new regular expression into an awk statement?
11h
comment using ls in bash
don't parse ls
1d
revised how to execute lines coming from a grep result?
added 185 characters in body
Feb
3
revised How to sleep until a given date & time?
remove editing cruft
Feb
3
answered Bash prompt execute command every time a new prompt is displayed
Feb
3
awarded  Nice Answer
Feb
3
comment carton: command not found
Without sudo, cpanm will install into, I believe, $HOME/perl5/bin so add that to the beginning of your $PATH.
Feb
2
comment Split string into array and print each element on a new line with commandline
@Costas, hmm, what if there's a space within a field? tr -s ', ' '\n' will split the field into multiple lines.
Feb
2
comment Split string into array and print each element on a new line with commandline
I'm not clear what you're really asking. You can translate commas to newlines with "tr": echo a, b, c, d | tr , '\n' -- that leaves spaces at the start of the b/c/d lines.
Feb
1
comment Automatic Paragraph Numbering
You may want to use $/="" in case paragraphs are separated by one or more blank lines. (or perl -00 -ne 'print "$.. $)"')
Feb
1
comment Automatic Paragraph Numbering
Well, the question is far from clear about what the input file looks like.
Feb
1
comment Automatic Paragraph Numbering
I wonder if cat -n filename would be sufficient.
Feb
1
answered cut column range sed/awk/cat
Feb
1
comment Double quotes issue in bash script
Isn't that what you want, given your comment above?
Jan
30
comment How to group a bunch of rows based on information from the first row?
You should show us what you tried so we can help you improve
Jan
30
comment How to group a bunch of rows based on information from the first row?
Can you not use the code given to you from your last question?
Jan
29
comment how to subtract first value from the last one within a column across a row in shell?
OK, you have blank lines in your input file. Add this line before if ($. == 1) => next unless @F;
Jan
29
comment how to subtract first value from the last one within a column across a row in shell?
You run it like perl -ane 'all the stuff in single quotes including newlines' input.txt > out.txt -- if this is a concern for you, I'd recommend going with choroba's answer
Jan
29
comment how to subtract first value from the last one within a column across a row in shell?
first comment: change $n == 3 to $n == 20. second comment: I don't understand what you're saying -- possibly you want to change < file to < the_real_name_of_your_input_file
Jan
29
answered how to subtract first value from the last one within a column across a row in shell?