1,718 reputation
58
bio website
location Ottawa, Canada
age
visits member for 4 years, 6 months
seen 12 hours ago

Developer at Pythian.
Big Tcl and Perl fan.
Enjoy Ruby and JavaScript too.


Jul
18
comment How to print regex match
with a string like (a) (b) (c), the basic regex (.*) would mach the whole string. with ([^)]\+), you are matching an open parenthesis and a close parenthesis, and in between you have one or more character that are not a close parentheses. That would match (a) in the string. This is a technique to make your regex less "greedy".
Jul
17
answered How to print regex match
Jul
17
comment How to print regex match
what is the output you wish to see?
Jul
6
comment Shell script won't run ruby script file
It looks like your scripts may have CR-NL line endings. Remove the carriage return: use dos2unix or sed 's/\r$//'
Jun
23
revised How to keep script from swallowing all of stdin?
added 52 characters in body
Jun
23
answered How to keep script from swallowing all of stdin?
Jun
14
comment How to split the output into different files?
For each line, set a variable f with the value of the first field concatenated with the string ".txt" (the awk concatenation "operator" is to put expressions side-by-side). Then print the file to the file named in the variable f.
Jun
13
revised How to split the output into different files?
give a value to the variable names
Jun
13
comment How to split the output into different files?
tail -n+1? That a pretty obscure way to say cat.
Jun
13
comment How to split the output into different files?
My edit is awaiting review. However, and the OP will need to provide an opinion, if your code sees a line beginning with "qux", that line will be added to "bar.txt" -- I suspect the OP would prefer "qux.txt"
Jun
13
suggested suggested edit on How to split the output into different files?
Jun
13
comment How to split the output into different files?
well, fix it and I'll remove my downvote
Jun
13
comment How to split the output into different files?
-1: the variables foo and bar are empty. You need a string on the right-hand-side of the redirection.
Jun
13
answered How to split the output into different files?
May
5
answered change user after ssh and execute multiple commands
Mar
11
answered how to make alias with quotes
Mar
11
comment how to make alias with quotes
It is customary to put awk's {braces} inside the quotes, but not strictly required. awk requires its program to be a single command line argument. You could write, if you were sufficiently perverse: awk {print\ \$2}
Mar
11
comment how to make alias with quotes
@JennyD, you cannot escape single quotes in a single quoted string. x='foo\'bar' does not work. You have to do something like x='foo'\''bar'. Ref: gnu.org/software/bash/manual/bashref.html#Single-Quotes
Feb
11
answered How to create batch of specific number of lines in linux
Feb
5
comment Is there a bash builtin for 'which'?
I like type -a myself. why the brackets in [t]ype?