582 reputation
1311
bio website bit.ly/GFscreener11
location stackoverflow.com@askmarcos.com
age
visits member for 2 years, 4 months
seen Apr 14 at 11:44

Pioneers are the ones with arrows in their backs.

Investment Portfolio Software, Trade Automation

Designer of infinite compression algorithms, and other research projects


Nov
5
revised crontab and DST disagreement with different timezone
Fixed nasty bash error "15 - 09: value too great for base" when 0* numbers treated as octal
Nov
5
comment crontab and DST disagreement with different timezone
In some cases got /bin/bash: 15 - 09: value too great for base (error token is "09") due to subtle problem of bash treatment of numbers beginning with 0 as octal. Fixed by preceding 10# to numbers.
Nov
4
accepted crontab and DST disagreement with different timezone
Nov
2
revised crontab and DST disagreement with different timezone
logic test was reversed
Nov
1
comment crontab and DST disagreement with different timezone
Um, the opposite of what I last wrote.
Nov
1
comment crontab and DST disagreement with different timezone
I don't like that 1. this isn't a host-timezone-indifferent solution, and 2. assumes the difference will never be greater than six hours, i.e., that DST in Poland will always end first and start last.
Nov
1
comment crontab and DST disagreement with different timezone
The idea is that for most of the year, a 1-hour wait will not be in effect. Only during the few weeks of a 5-hour difference (whether spring or fall), rather than the typical 6, will sleep 3600 be executed.
Nov
1
comment crontab and DST disagreement with different timezone
Minor update. en.wikipedia.org/wiki/Tz_database implies that since the DST rules for each zone are published into the TZ database, any up-to-date UNIX server should already have bundled knowledge of the wall clock time anywhere else in the world without having to consult over the network.
Nov
1
answered crontab and DST disagreement with different timezone
Nov
1
comment crontab and DST disagreement with different timezone
Thanks for the kluge; 9am was only a simplified example, in reality I have tasks sprinkled all over the clock and calendar. Developing on your idea, rather than stuffing my much longer, nastier crontab line into an if block, I could merely precede my commands with: ` [ $[$(date +%H) - $(TZ=":US/Eastern" date +%H)] == 5 ] && sleep 3600; w` where w is what I want to run at the right time
Nov
1
revised crontab and DST disagreement with different timezone
added 286 characters in body; edited title
Nov
1
comment crontab and DST disagreement with different timezone
No; I don't want all, and according to some other posts, TZ doesn't necessarily affect crontab (in Ubuntu which I use it doesn't), unlike for date eg. TZ=":US/Eastern" date +%Y%m%d
Nov
1
asked crontab and DST disagreement with different timezone
Sep
4
awarded  Popular Question
Jul
10
answered history list in bash always truncated to 5000 lines at new login
Jul
5
answered How do I background an SSH session?
Jun
19
comment shorten long lines in a log file
I think I see; what's needed is a variable-length regex between the 130 and 40 matchers. So this might be the final sed way: sed -i.bak -e 's/^\(.\{80\}\).\{130,\}.*\(.\{40\}\)$/\1 ... \2/' All those \ make it annoying to read, but I understand why they're necessary. The awk way is more human readable for someone not used to these regexes.
Jun
19
comment shorten long lines in a log file
I get your 1st example (though haven't tested if it still prints shorter lines unchanged). In your 2nd example, doesn't the middle search expression catch strings of exactly 130 length only (hence 250 char lines)?
Jun
18
comment shorten long lines in a log file
Also useful esp. with -i, as I may be looking to keep closer to only the first 1024 and last 1024 chars, which shouldn't modify most lines, only ridiculously long ones. Still the awk method lets me replace the middle with a " ... " easily in such cases.
Jun
18
comment shorten long lines in a log file
Minor detail, I was able to make do without the extra len variable altogether