513 reputation
414
bio website porkmail.org/era/unix/…
location
age
visits member for 3 years, 5 months
seen Mar 26 at 21:38

What every SO question looks like


Mar
26
revised Can I get an array as an option argument in bash script
Clarify wording
Mar
26
suggested approved edit on Can I get an array as an option argument in bash script
Mar
12
answered Bash scripting: Using wildcard
Mar
12
answered bash variables: expanding the values of variables whose names match a pattern
Mar
12
answered linux-tomcat - add command to startup.sh
Mar
6
revised FROM: header is forged, SENDER: is legit , spam is delivered. how to detect?
Fix HTML entities in example
Mar
6
comment Bash evaluation baffling
Your cat | sed | awk abomination seems to only pick out the decimal part of the load average and using it as an integer. The diagnostics you show are not consistent with this. Are you sure this is the code you are actually running?
Mar
6
comment Load users environment variables in a cronjob
Added stuff from stackoverflow.com/a/15574078/874188 -- thanks @FedericoSierra.
Mar
6
revised Load users environment variables in a cronjob
Note from linked SO question
Mar
6
revised Load users environment variables in a cronjob
Probably better to just run Bash and be done with it
Mar
6
comment Load users environment variables in a cronjob
Oh, if the Bash start-up files contain Bash-only syntax, that won't work either -- you'll get export: command not found instead. Better really to put these in a Bash script and call that from Cron. Updated answer.
Mar
6
comment Load users environment variables in a cronjob
You forgot to fix the source: command not found error. Sorry about not mentioning it in my very initial answer.
Mar
6
comment Resolve packages not found and errors during configure,make,make install in a script
This has been resolved multiple times by multiple packaging systems already. The approach taken by both RPM and Debian is to create a build wrapper which reads the dependencies from a simple spec file. This needs to be maintained by hand for every package, but there are so many other things you need to tweak anyway that this is a minor nuisance.
Mar
6
comment Bash: Output of a command is written only to screen and not to another file while using tee, what could be the reason?
You are also using double redirection. print_log appends to $log and then you pipe to tee -a $log as well. The pipe will never receive any input so you could simply remove it; or for consistency, you could change the function so it just logs to stdout. The whole thing would be more elegant if you just added done | tee -a "$log" at the end of the loop, rather than redirect every command inside the loop. Then you can fix wget by just adding 2>&1 there.
Mar
6
answered Load users environment variables in a cronjob
Mar
6
comment Exim4 configuration to use several external ip for mail sending
You are just digging yourself deeper into the hole if you try to evade their policy restrictions. See what you can do to simply send less email into Gmail, or get a proper agreement with them to have you exempted from the restriction.
Mar
6
comment Issue with Bash Script On FreeBSD
As an aside, collecting the output from find into a variable only to print the value of that variable is rather pointless. Just run the find command after the headers and have it print its output into the report. Somewhat similarly, grep 'interactive/pam' /var/log/auth.log avoids a completely useless cat and drops the (here) redundant -E flag.
Mar
6
comment Issue with Bash Script On FreeBSD
I would add head -n 2 /var/log/auth.log; tail -n 2 /var/log/auth.log to get an idea of what's in the log file at the time the script runs.
Mar
6
comment Issue with Bash Script On FreeBSD
The parentheses around (true) are useless.
Mar
6
comment Should I be adding aliases to /etc/profile instead of /etc/basrhc?
You should be using shell functions, not aliases. Aliases are less featureful, more brittle, and offer no advantages over shell functions.