5,996 reputation
616
bio website
location Ottawa, Canada
age
visits member for 2 years, 4 months
seen 8 hours ago
stats profile views 181

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


1d
comment perl one liner + how to replace any last IP address octets
You're passing stdin and also specifying a file name that probably doesn't exist (Do you have a file named "1.1.1.1"?) -- I get echo 1.1.1.1 | perl -pe 's/(\d+\.){3}\K\d+/0/g' -> 1.1.1.0 -- this is perl v5.16.3, I'm not sure when \K was introduced.
1d
answered perl one liner + how to replace any last IP address octets
2d
revised How to test whether the file is crlf or lf without modyfing it?
added 159 characters in body
2d
answered How to test whether the file is crlf or lf without modyfing it?
2d
comment Shell: How do I get the last argument the previous command when it was detached?
It makes me chuckle when 3 characters is too much typing. As soon as the previous command has more than 3 arguments, I win!!!1! :)
2d
comment Shell: How do I get the last argument the previous command when it was detached?
True, it's a placeholder only.
2d
comment how to display I/O file on shell
Also asked on superuser -- please stick to one forum please.
2d
answered Shell: How do I get the last argument the previous command when it was detached?
Jun
14
comment Using sed, how to format one word per line, removing white space
@don_crissti, leading spaces are actually removed, but awk treats the empty string before the whitespace as an empty record. I've updated to only print non-empty records
Jun
14
revised Using sed, how to format one word per line, removing white space
added 6 characters in body
Jun
14
comment Using sed, how to format one word per line, removing white space
This might be more secure: while read -ra words; do (( ${#words[@]} )) && printf "%s\n" "${words[@]}"; done < file
Jun
14
answered Using sed, how to format one word per line, removing white space
Jun
13
comment how to loop through arguments in a bash script
There's a shorthand for this for f; do ...
Jun
11
answered How do I trigger autocomplete without a tab key?
Jun
11
comment How to export variables that are set, all at once?
set also displays functions and system variables like BASH_VERSION
Jun
11
comment How to export variables that are set, all at once?
Very similar to unix.stackexchange.com/q/79064/4667
Jun
11
revised How to export variables from a file?
added 408 characters in body
Jun
11
answered How to export variables from a file?
Jun
9
comment Prompt user for sentence and store it without being disturbed by spaces
Pity you're using an older version of bash. bash 4 has associative arrays which would make things much neater.
Jun
6
awarded  Nice Answer