828 reputation
1614
bio website
location
age 34
visits member for 3 years, 10 months
seen 2 days ago

mmmm, coffee


2d
comment How to recursively delete a dir after find
That deletes files named DIR-NAME, not files inside DIR-NAME/
2d
comment What is “jobs” commmand in Redhat Linux
serverfault.com/questions/41959/… . Also try typing "help jobs".
Dec
14
awarded  Popular Question
Dec
9
answered How to convert dashed string to spaces and caps?
Dec
5
answered cd into all directories, execute command on files in that directory, and return to previous current directory
Dec
4
awarded  Notable Question
Nov
19
comment Efficiently copy names in shell
True X-Mouse for highlight-to-copy, middle-click-to-paste in Windows.
Nov
18
comment Strange bash sytax error depending on sudo usage
Could you have been running into stackoverflow.com/questions/23850668/… ? If you sudo ls ~/ (or sudo ls $HOME) the expansion happens before running the command as sudo, so you see your home directory. If you sudo ./a.sh where a.sh just says ls $HOME, you'll see root's home.
Nov
14
comment Strange bash sytax error depending on sudo usage
1. I don't think this will work as you expect anyway: it will cd to /root when you run it with sudo. 2. This sounds a lot like an A-B question. WHY do you need to tell if a script is being run by root rather than being run from sudo?
Nov
11
comment Centos web camera, fast application for snapshot?
maybe raspberrypi.stackexchange.com/questions/1714/… or askubuntu.com/questions/122899/… will help you? I used fswebcam and it takes about .6 seconds to grab a photo from /dev/video0. I think part of the delay is due to the camera warming up, see ubuntuforums.org/…
Oct
30
revised How can a script ask me questions?
Good, simpler suggestion from a commenter.
Oct
30
comment How can a script ask me questions?
@MJA yep. So do it like Costas said to make it more readable. Or take parameters from the command-line, using something like getopts.
Oct
30
answered How can a script ask me questions?
Sep
28
awarded  Famous Question
Sep
8
comment Go up one level from a nonexistent path
Great answer (I came to post basically the same thing), but it will loop forever if there is no '/' in $dir and $dir isn't a directory.
Apr
26
revised line 7: [: echo: integer expression expected
indent code so it will look better
Apr
26
comment line 7: [: echo: integer expression expected
@JonathanLee if something doesn't work, you can try the commands in your terminal one-by-one to see what's happening. So type x='echo test|wc -m' then type echo $x to see what value 'x' got.
Apr
26
suggested approved edit on line 7: [: echo: integer expression expected
Apr
23
awarded  Good Question
Mar
19
comment Why is iterating over a file twice faster than reading it into memory and computing twice?
I tried something similar with a 300k-line, 30MB file. According to time, it took .086s to tail -n 1000000 stdout.log > /dev/null, but after reading it into the log variable like you did, it took 3.617s to echo $log > dev/null. Maybe you could simplify your question? (PS instead of grep | wc maybe you could use grep -c)