glenn jackman

Ottawa, Canada

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

8h
awarded Nice Answer
11h
answered Sending a post json with curl get error
13h
comment why failed ksh file for sftp unix?
Are you aware that you used LOCALFILE when you probably meant REMOTEFILE. Also, get out of the habit of using ALL_CAPS_VARS: one day you'll redefine $PATH and then wonder why your script is broken.
13h
comment How I can make alias called when it's called by a varible
This question has been superceded by this one: stackoverflow.com/q/27193033/7552
13h
comment Shell recognizes files in ~ but not in ~/Documents
I don't understand your comment. How will the for loop behave if there's a file named hello world.txt in ~/Documents/?
13h
comment Shell recognizes files in ~ but not in ~/Documents
No, use a bash array instead: docs=( ~/Documents/* ); for file in "${docs[@]}"; do ... -- anything else will not be able to handle files with whitespace.
13h
comment Shell recognizes files in ~ but not in ~/Documents
Precisely. This is one of the downfalls of parsing ls. You should do something like this instead: for file in ~/Documents/*; do ...
13h
comment How to add a script call to a linux command?
If you do not alter /bin/ls, there is no way to prevent the user from invoking /bin/ls directly.
13h
comment How to add a script call to a linux command?
To avoid recursion, change your function to ls() { /root/myscript.sh; command ls "$@"; }
13h
comment Shell recognizes files in ~ but not in ~/Documents
If your current directory is ~, what do you see when you type ls DocList.txt ? Compare that to ls ~/Documents/DocList.txt . Now, consider that your script is doing the same thing.
14h
answered channel ID not supported for array print
17h
comment How do you create a Bash Script for replacing text in a document, utilizing regular expressions?
manpages.ubuntu.com/manpages/trusty/en/man1/sed.1.html
17h
comment shell_exec how to pass arrays
I'm not a PHP guy, but you'll need to add your elements as a space-separated string to the command: "php script.php " + join(" ", $array), or something like that
19h
comment iterate lines containing zeros in bash
Instead of echo ${a//0/-1e+10}, echo "-1e+10" would be sufficient.
1d
answered extract/split from string in bash
1d
comment why do we need nested procedures in tcl
The docs say: "rename oldName newName ... If newName is an empty string then oldName is deleted."
1d
comment Expect to send the Ctrl+A to the browser
Expect cannot work with GUI programs like chrome. You might have better success with xdotool
1d
answered How use a variable in switch regexp
2d
answered Isolate a term in a line
2d
comment Bash Command Line Colors
fish does too
1 2 3 4 5