glenn jackman

Ottawa, Canada

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

7h
comment Check if remote file exist and perform some other operation in expect script
@Nagarjun, this is one of the annoying things about expect: you have to parse out the command you sent to extract the results. Also, be careful with your syntax: Expect and Tcl, like sh/bash, parses commands and arguments using whitespace, so you need a space between if and { (see the complete Tcl syntax)
7h
comment Check if remote file exist and perform some other operation in expect script
@IInspectable, expect uses \r (carriage return) to represent "hitting enter"
7h
comment How to move directories that were listed in a .txt file?
right, thanks. I was coming from a different question, so I wasn't that focussed.
7h
revised How to move directories that were listed in a .txt file?
added 20 characters in body
7h
comment Script crashing after entering argument
Probably after sending your $outlet, the next ">" doesn't show up and the program times-out. Run your script with expect -d and expect can show you (verbosely) what's going on.
17h
answered Output negative values, regardless of original sign, on selected lines
17h
answered How to read symbol separated strings from a variable, convert to numbers, and perform arithmetic?
18h
comment How to delete files listed in a text file
You can also handle "whitespace but not newlines" in the filenames with xargs -d '\n' rm < file
18h
answered How to move directories that were listed in a .txt file?
18h
revised Array not passing values to for loop
added 2 characters in body
18h
comment Finding special characters in name
The POSIX character class [[:space:]] should work.
1d
comment In place modification of a line read in a file using perl script
Good points all. I've never ventured into the guts.
1d
revised Compress working directory purely using bash regex
add perl and PS1
1d
comment Compress working directory purely using bash regex
Thanks Charles, good point.
1d
revised Compress working directory purely using bash regex
safer, no unquoted variable expansion
1d
comment Compress working directory purely using bash regex
Oops, you just wiped out your $PATH variable. Don't use ALL_CAPS_VARNAMES
1d
comment In place modification of a line read in a file using perl script
for the array method, we can at least reduce the number of writes to the file: print $OUTPUT join("\n", @array), "\n";
1d
answered Compress working directory purely using bash regex
1d
answered Difference between interact, expect and exit in expect script
1d
answered Use shell pipe or vertical bar "|" with NodeJs spawn()
1 2 3 4 5