1,683 reputation
58
bio website
location Ottawa, Canada
age
visits member for 4 years, 6 months
seen Jul 6 at 12:38

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


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?
Jan
31
comment Linux Bash IF conditions not processing when running as crontab
Are you executing this script with "sh" or "bash"?
Jan
23
comment running a remote shell script that switches to a user does not return to the issuing local server shell
asking the same question on multiple sites is discouraged: stackoverflow.com/q/21314886/7552
Jan
23
answered running a remote shell script that switches to a user does not return to the issuing local server shell