17,552 reputation
1539
bio website
location Ottawa, Canada
age
visits member for 3 years, 9 months
seen 11 hours ago

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


1d
revised Does anyone know how to make a text based game in Unix
added 36 characters in body
1d
revised Using s command to subsitute variables
edited tags
Nov
23
comment Using `select` command to print menu in Linux
Clarification: break does not "prematurely" exit the select command -- select will loop forever unless "broken".
Nov
21
awarded  Nice Answer
Nov
21
comment Bash Array Comparision
So just negate it: if ! [[ $elem =~ $re ]] or grep -v -Ff ...
Nov
20
answered Bash Array Comparision
Nov
20
revised Bash Array Comparision
syntax errors without the quotes
Nov
20
revised Bash Array Comparision
assuming the first array does not actually contain wildcard chars
Nov
20
comment Using `select` command to print menu in Linux
@syntaxerror, you're right, you don't need break for case. However, you need a break to escape the select loop.
Nov
20
comment Why is my script calling multiple functions?
variables don't get assigned inside [ ... ]. What's happening is that the [ command only receives one argument (other than ]) -- the string "$choice==1". When test (or [) receives a single argument, the success condition is that the string is non-empty.
Nov
18
comment Store stdout in variable and send command to background
basically same question here: stackoverflow.com/q/27003331/7552
Nov
18
answered Store stdout in variable and send command to background
Nov
18
comment how to run multiple versions of one shell on a single machine
I meant chroot
Nov
18
comment how to run multiple versions of one shell on a single machine
Can you set up different login environments with chroot?
Nov
17
answered SED command not replacing (working regex)
Nov
14
comment Delete every Nth line in shell
in this example, we want to delete lines 1 and 4, so NR%3==1
Nov
13
comment Randomize arguments ( that hold color codes) from an array
You want the user to type the word "random"?
Nov
13
comment Distance of a command from a shebang?
+1 for actually benchmarking
Nov
13
comment Output part of each line to a separate file
While that is cool, it's quite inefficient, having to spawn an external command for every line. It would be a bit better having the sed output all the raw commands, and pipe the output into "sh"
Nov
12
answered Match missing values in text files