Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'View upcoming events on multiple Unix calendars' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View upcoming events on multiple Unix calendars
Authored by: kitzkikz on May 15, '06 10:50:17AM
There's no need for a temporary file. Use shell's built-in parenthesis (also called a sub-shell). This would prevent two user's running the script at the same time and overwritting each other's results, unnecessary usage of temporary storage, and allow the shell to optimize where possible by allowing it to use a memory buffer instead of forcing it to use disk.

#!/bin/sh
(
calendar -f /usr/share/calendar/calendar.computer -l 0
calendar -f /usr/share/calendar/calendar.usholiday -l 0
calendar -f /usr/share/calendar/calendar.birthday -l 0
calendar -f /usr/share/calendar/calendar.christian -l 0
calendar -f /usr/share/calendar/calendar.freebsd -l 0
calendar -f /usr/share/calendar/calendar.history -l 0
calendar -f /usr/share/calendar/calendar.music -l 0
calendar -f ~/.calendar/calendar -l 14
) | sort -M



[ Reply to This | # ]
View upcoming events on multiple Unix calendars
Authored by: n1mie on Jun 07, '06 02:42:22PM

This is the best solution I've seen. I appreciate the education offered by all the respondents, especially this one.

Thanks, I learned a lot, even while trying to share.

---
--Chip



[ Reply to This | # ]