1,356 reputation
48
bio website
location Ottawa, Canada
age
visits member for 3 years, 4 months
seen 2 days ago
stats profile views 40

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


May
9
comment Solution to start/stop many instances of one application
any thoughts on killall versus pkill?
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
Use the ssh options -t or -T to force/disable a pseudo-tty, depending on your needs. That will at least take care of the error message.
Apr
18
comment bash: use outside variables when reading multiple lines into ssh
What's happening is that you're logging on to the remote server, running bash non-interactively, and that exits right away. Then the commands in the heredoc get executed. Simply remove "/bin/bash" from the ssh command and it will execute the heredoc remotely.
Apr
3
comment run expect script from other shell
Also asked on unix&linux
Jan
24
comment Setting “say” alias for espeak on Ubuntu Linux
Also, aliases do not use positional parameters. You would need to use a function: say() { espeak -s 120 2>/dev/null <<< "$*"; }. But @John has given you the correct answer.
Jan
17
comment split array element with special character
Are you looking for a "return code" for each line?
Jan
16
comment split array element with special character
Is that the output of the Perl script that you now want to reformat? Or is that what you want to see and you have not shown what Perl outputs? I don't see any ~ characters there.
Jan
16
comment split array element with special character
Add that information to the question so you'll be able to format it properly.
Jan
15
comment split array element with special character
What is the output of the Perl program?
Jan
11
comment Export system wide env variables at boot
yes. Or you could wrap the client in a shell script that sources the profile.
Jan
11
comment Export system wide env variables at boot
Can you have the puppet client source /etc/profile?
Dec
10
comment bash/sed/awk/etc remove every other newline
A late comment: 1) always use a format specifier for printf in case the string has percent signs, 2) to avoid the duplicated last line, set $0 to "" -- awk '{printf "%s", $0; $0=""; getline; print " " $0}'
Nov
15
comment linux + match only VALID IP from text file into other file
In fact, can tighten up the one-liner: perl -MRegexp::Common=net -lne 'print for /(?<!\d)($RE{net}{IPv4})(?!\d)/'
Nov
15
comment linux + match only VALID IP from text file into other file
Use lookaround assertions to eliminate the false positives: /(?<!\d)($RE{net}{IPv4})(?!\d)/
Nov
15
comment linux + match only VALID IP from text file into other file
If you use grep -oP you can use look-around constraints to limit the invalid first and last octets: grep -oP '(?<!\d)(1?\d?\d|2[0-4]\d|25[0-5])(\.(1?\d?\d|2[0-4]\d|25[0-5])){3}(?!\d)'
Aug
23
comment Problems with bash variable expanding with single quotes
@drcelus, in what context do single quotes appear? If it is in set -x output, don't worry about it: they appear just for your (visual) benefit, they don't affect the execution of the command.
Jul
27
comment calling a variable in find regex
Also asked on stackoverflow: stackoverflow.com/q/11685643/7552
Jul
22
comment .bashrc: shopt: not found
I find that's not always accurate (may depend on one's rc files). From bash, try /bin/sh -c 'echo $SHELL' -- for me that returns "/bin/bash" even though my /bin/sh is a symlink to dash.
Jul
22
comment .bashrc: shopt: not found
Agree with @womble. Even the error messages say sh. What does cat /proc/$$/cmdline show?
May
18
comment Sending content of a file in Expect
do you want to send the file or receive it?