4,858 reputation
621
bio website
location Ottawa, Canada
age
visits member for 3 years, 11 months
seen 12 hours ago

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


1d
comment SFTP change notifications
Do you know what the directory hierarchy is? If not, unfortunately the sftp ls does not have a recursive option, so you have your work cut out for you parsing the ls output for files versus directories and descending into subdirectories programmatically. If you do know the dir structure, then you have to program the cd somewhere; ls
1d
answered SFTP change notifications
Jan
21
answered How to compare two (vague) file lists and print the duplicates?
Jan
21
comment Match Pattern and write following value as variable
The nice thing about the ruby solution is that it takes care of all the quotes and escaped quotes. It should not be much more heavyweight than jq and whatever.
Jan
21
comment Match Pattern and write following value as variable
untested, but awk 'NR==2 {sub(/.*filename=(\\")?/,""); sub(/(\\")?"$/,""); print; exit}' should replace all your seds
Jan
20
answered Match Pattern and write following value as variable
Jan
20
comment Match Pattern and write following value as variable
Is this JSON data?
Jan
14
comment How to display all services and version that runs on a host?
Can also remove the head/tail bits: nmap ... | awk '$1 ~ /^[0-9]+\/..p$/ {print substr($0, index($0, $3))}' -- the awk regex should catch services listening on tcp or udp.
Jan
13
comment How to use 'if' inside '-exec' attribute of 'find'?
You probably just need -depth to ensure that files are removed before their directories are.
Jan
12
answered How can I refer to all files that are named using two numbers?
Jan
12
answered interchange 2 strings in file terminal command
Jan
10
comment Ubuntu / Bash recognising “export PATH=$PATH:~/…” but not “export PATH=$PATH:/home/…”
Go for it. It's only the first part anyway.
Jan
9
comment Alternatives for [variable = string substitution] in bash
@aliteralmind, note carefully there are 2 leading / and no trailing /g: echo "${origPath//\//\\}". // to replace all, \/ to search for a slash (escaped to not clash with ->), / to separate the search and replace test, \\ to substitute a backslash. See gnu.org/software/bash/manual/…
Jan
9
comment Ubuntu / Bash recognising “export PATH=$PATH:~/…” but not “export PATH=$PATH:/home/…”
Your home directory is probably not /home/, it's probably something like /home/sibow/. Do this to see for yourself: echo ~ and ls /home
Jan
4
comment Deleting first letter of each line
Probably requires GNU sed for \S and \w. Portably, you'd write [^[:blank:]]
Jan
3
comment sqlite make test fails because of “tcl.h not found” or “undefined reference to Tcl_Free”
I suggest you ask on StackOverflow -- that's where the Tcl experts are.
Dec
24
comment cat vs grep vs awk command get the file content which one is more efficient and less time consuming?
You might also want to benchmark sed "" temp.txt
Dec
24
comment cat vs grep vs awk command get the file content which one is more efficient and less time consuming?
I feel compelled to point out that we're on the millisecond scale here. In practical terms, the difference is vanishingly small. en.wikipedia.org/wiki/Program_optimization#When_to_optimize
Dec
24
comment cat vs grep vs awk command get the file content which one is more efficient and less time consuming?
Note that awk 1 temp.txt should be quicker than awk '/$/' temp.txt since it doesn't have to compare each line to a regex.
Dec
23
comment Glob behavior differences between script and command line
I suppose you could do alias ldr='ls -dlrta' to get the same effect