In 2014, I modified the script to calculate the date instead. The nature of the job required using Sunday's date to ensure as much information as possible was included for the handheld computers.
I stumbled across a file containing some of the middle steps I took to modify the script calculate the correct date to use.
x=091509
y=$(printf 'puts [clock format [clock add [clock scan "%s" -format "%%m%%d%%y"] -1 day] -format "%%Y%%m%%d"]' "091509" | tclsh)
puts [clock format [clock add [clock seconds] -1 day] -format %Y%m%d]
set current_date [clock seconds]
set day_of_week [clock format $current_date -format %w]
set tmp "${day_of_week} days"
set relative_time [clock scan "-${day_of_week} days" ]
set sunday [clock format [expr $current_date - $relative_time] -format %m%d%y]
puts [clock format [clock scan "-[clock format [clock seconds] -format %w] days" ] -format %m%d%y]
and the final code that went into the file.
set sunday [clock format [clock scan "-[clock format [clock seconds] -format %w] days" ] -format %m%d%y]
send -- "${sunday}\r"
Time being what it is, I really don't remember how this works. I did a lot of googling about tcl at the time. This script was effectively retired two years ago.
No comments:
Post a Comment