489 reputation
16
bio website
location
age 43
visits member for 1 year, 11 months
seen yesterday

Jul
19
comment ifconfig command not found
Did you perhaps mean /sbin/ifconfig? Looking at my system, I can't find an /sbin/config either. BTW, what do you get from ls /sbin/ifconfig?
Jul
8
comment Slow Linux machine
For the processor count I'd suggest grep -c processor /proc/cpuinfo to get the relevant information without redundancy.
Jul
6
answered count lines in a file
Jul
6
comment count lines in a file
Why not simply grep -v '^+ *%' matlab.git.diff | wc -l?
Jul
6
comment What do the fields in ls -al output mean?
Which system includes symbolic links in the link count?
Jun
24
comment How to simulate user interaction when running another script
If password entry is involved, you probably need a tool like expect.
Jun
22
comment Gcc configuration error
And no output for config.sub?
Jun
22
comment Gcc configuration error
What's the output of ls -l /bin/sh ../gcc-svn/config.sub?
Jun
21
comment Weird Wi-Fi connection issue on Linux Mint 16
I don't think it's a wise thing to publish your WLAN password here. You certainly should change it as soon as possible now.
Jun
19
answered What's the difference of the Userland vs the Kernel?
Jun
14
comment “find: .: No such file or directory” while using find on the current directory
Does stat . work? Also, what happens if you use find /srv/www/htdocs -name index.php?
Jun
14
comment Use find to find certain directory and delete all files in it except one directory
Well, one (dirty?) trick would be to use GNU tar with the --remove-files and --exclude options, and then delete the tar files (as bonus, if you accidentally removed a file you didn't intend to, and notice it before deleting the tar file, you can simply restore it from that archive).
May
19
comment Difference between cat and '>' to zero out a file
So to clear a file, you just have to apply the right smiley :>
May
16
answered Using trap with ERR: How do I send $?
May
16
comment Using trap with ERR: How do I send $?
exec 2>somefile at the beginning of the script should suffice.
May
16
answered To env or not to env
May
16
comment Using trap with ERR: How do I send $?
@FelixFrank: From bash's man page: "A SIGNAL_SPEC of ERR means to execute ARG each time a command's failure would cause the shell to exit when the -e option is enabled." So no signal here. And yes, that event itself is also not associated with standard error, but usually failing commands write something to standard error before they exit with non-zero exit status (which is what Gregg Leventhal wants to send). And if you store everything written to standard error by your script into a file, then that file will especially contain the error output of the failing command.
May
16
comment Using trap with ERR: How do I send $?
What about redirecting stderr to a file from the beginning (for the complete script), and then just sending the contents of that file on error? As added bonus, if mailing fails for whatever reason, you still have the file locally to look what happened.
May
8
comment Colors in Man Pages
Indeed, the translation of underline into blue has historic reasons, going back to the text modes of the original PC graphics adapters MDA and CGA (actually the CGA text modes are still available to date). Those graphics adapters stored two bytes per character: One holding the ASCII code, one holding the attributes. The MDA interpreted the attribute byte as combinations of underline, bright, blinking and inverse, while the CGA interpreted that byte as foreground and background colour. And it happened that the MDA attribute for underline equalled the CGA attribute for blue on black.
May
5
comment What is the best way to create remote tunnel?
Is 20.0.0.0/24 actually available for local use? I thought only 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 were available for local use.