371 reputation
14
bio website
location
age
visits member for 3 years, 7 months
seen Nov 25 at 3:25

Nov
24
comment How can variables use “~” for cd'ing?
@hvd: you actually have to leave the slash unquoted as well. BASE=~/"quoted name" works, but BASE=~"/quoted name" doesn't.
Nov
10
comment Emulating /etc/cron.d/ on OSX
Ah, I misunderstood; in that case, the answer is that OS X's version of cron doesn't have that feature. But actually, I'd argue that since you'd have to do it differently on OS X anyway (adding a line to /etc/crontab rather than dropping a file in /etc/cron.d), you might as well go all the way and drop a file in /Library/LaunchDaemons instead.
Nov
10
answered Emulating /etc/cron.d/ on OSX
Jul
24
comment bash script loses readonly value after first time thru loop
If double-quotes around the array reference are causing trouble, I'm pretty sure there's something wrong with how the array is being constructed; removing the double-quotes should not be necessary. I'd concentrate on figuring out what's building the array wrong.
Jul
2
answered Piping content with multiple spaces
Jun
26
answered user input not accepted in nested case statement
Jun
17
comment How Does Linux deal with shell scripts?
This behavior is version-dependent. I tested with bash version 3.2.51(1)-release, and found that it didn't buffer past the current line (see this stackoverflow answer).
Jun
15
awarded  Commentator
Jun
15
comment Comparison of decimal numbers in bash
To illustrate the importance of the difference between string vs. numeric comparison, consider that [[ 11.56 < 2.90 ]] (and [[ ((11.56 < 2.90)) ]] and...) is true, because "1" comes before "2" in ascii sorting order.
May
19
comment Why do bash variables disappear when I use xargs?
In this case, I think >( ) is the form wanted. Something like ... done > >(xargs ... )
Apr
30
answered bash_profile stops after file call
Feb
3
awarded  Yearling
Jan
31
answered UDP commands for Linux and Mac?
Sep
19
answered How can I mimic `sudo su - user` in a script?
Aug
28
comment How to clear environment variables in launchd?
Each process has its own separate set of environment variables. The export command only exports a variable to subprocesses created by that particular shell process (and only those it spawns after the export command). There is no way for one shell to change the environment of another running process.
Feb
3
awarded  Editor
Feb
3
revised What is Darwin's 'private' directory for?
Added note on incompleteness
Feb
3
answered What is Darwin's 'private' directory for?
Apr
2
comment How can I create a file with multiple lines from the command-line?
Yup. I've been bitten when echo's behavior changed in a system update, and some of my scripts broke...
Feb
25
comment Exporting environment variable
Don't use eval $hello, use eval "$hello". Without the double-quotes, some unwanted parsing is done, which can cause very weird bugs. See this answer for an example (in a rather different situation, but the same principles apply).