Reputation
Next tag badge:
97/100 score
36/20 answers
Badges
18 145 291
Newest
 Nice Answer
Impact
~4.4m people reached

Jun
5
comment How to block telnet using iptables command
telnet is an extensible protocole. There exist encryption extensions for telnet.
Jun
4
comment How to find line with least characters
See Why is using a shell loop to process text considered bad practice?
Jun
4
comment dd-style parameters to a bash script
Note that there's some improvement comming, see that thread on the bash-bug mailing list.
Jun
4
comment dd-style parameters to a bash script
Note that with the next version of bash, you may need to add +c to disable compound variables or +F to disable floating ones. I'd still use eval where you know where you stand.
Jun
4
answered dd-style parameters to a bash script
Jun
4
comment dd-style parameters to a bash script
Alternative to using a hash, you could prefix the variables like myscript PATH=b would assign b to $myscript_PATH. Then, you could make it work with POSIX syntax.
Jun
4
comment dd-style parameters to a bash script
@lcd047, also note that [a-z] matches â in most locales (and not ź as that comes after z), but it doesn't match letters from other alphabets (which bash allows if they are single-bytes like in locales with cyrillic single-byte charsets).
Jun
4
comment dd-style parameters to a bash script
@lcd047, bash allows [[:alpha:]_][[:alnum:]_]* for variable names, but currently has a bug in that it doesn't work for multibyte characters. So yes, â is a valid variable name but only in locales where that's expressed as a single byte.
Jun
4
comment dd-style parameters to a bash script
declare is about as dangerous as eval (one may even say worse as it's not as apparent that it is as dangerous). Try for instance to call that with 'DIRSTACK=($(echo rm -rf ~))' as argument.
Jun
4
comment dd-style parameters to a bash script
Then the code would be eval "out=\${$key}". eval out=\$val is out=$val.
Jun
4
revised dd-style parameters to a bash script
simplification. eval out=\$var is out=$val, but there's no point using an intermediate variable here.
Jun
4
revised How to tell gzip to keep original file?
added 186 characters in body
Jun
4
comment ls -e option not available in linux
Note that that has nothing to do with Linux. Linux is only a kernel. Systems with a Linux kernel often also have GNU utilities which may be the one you're refering to. Some other Linux based systems have busybox ls instead, some have no ls at all. It would be better to specify the OS instead (Debian/RedHat/ChromeOS/Android/OpenWrt..) or the implementation of ls (like GNU, busybox, heirloom (a port of OpenSolaris tools))
Jun
4
awarded  Nice Answer
Jun
4
comment timestamp, modification time, and created time of a file
[OT] @Benubird, yes it could be useful to others. My answer has other alternatives.
Jun
4
comment timestamp, modification time, and created time of a file
@Benubird. the access time would be updated upon ls. Probably you're on Linux and the filesystem has been mounted with relatime or noatime options. Try mounting with strictatime (but beware of the performance implications). (BTW, are you planning to undelete your fifo question or have you given up on it altogether? I had done a longish answer to it.)
Jun
4
revised Find files containing one string but not the other
edited body
Jun
4
revised Find files containing one string but not the other
added 83 characters in body
Jun
3
comment Make pwd result in terms of “~”?
@mr.spuratic it's only correct (except for the usage of echo) in zsh. In other shells, $HOME would be treated as a pattern and the whole thing subject to split+glob.
Jun
3
revised Make pwd result in terms of “~”?
added 278 characters in body