And one sad servitude alike denotes
The slave that labours and the slave that votes.
Has anyone else experienced the same thing?
export sec=$(date +%S)
#Â pour une raison inconnue, il faut un double crochet au niveau du test de $hour contre notdef. Pourquoi?
if [ $sec == 00 ] || [ $min == notdef ] ; then export min=$(date +%M); if [ $min == 00 ] || [[ $hour == notdef ]] ; then export hour=$(date +%H); if [ $hour == 00 ] || [ $day == notdef ] ; then export day=$(date +%d) wkday=$(date +%A); if [ $day == 01 ] || [ $mnth == notdef ] ; then export mnth=$(date +%B); if [ $mnth == 01 ] || [ $year == notdef ] ; then export year=$(date +%Y); fi ; fi ; fi ; fi ; filancelot wrote:
- Code: Select all
export sec=$(date +%S)
#Â pour une raison inconnue, il faut un double crochet au niveau du test de $hour contre notdef. Pourquoi?
if [ $sec == 00 ] || [ $min == notdef ] ; then export min=$(date +%M); if [ $min == 00 ] || [[ $hour == notdef ]] ; then export hour=$(date +%H); if [ $hour == 00 ] || [ $day == notdef ] ; then export day=$(date +%d) wkday=$(date +%A); if [ $day == 01 ] || [ $mnth == notdef ] ; then export mnth=$(date +%B); if [ $mnth == 01 ] || [ $year == notdef ] ; then export year=$(date +%Y); fi ; fi ; fi ; fi ; fi
if [ $mnth == 01 ] || [ $year == notdef ]
if [ $mnth == January ] || [ $year == notdef ]
BioTube wrote:in the kernel(unlikely, we've had other leapseconds before and it'd be shoddy programming not to handle them)
EDIT: I don't think you're gaining any CPU time by doing this way anyway. I'd imagine that the date command takes about the same time no matter which date format you request.
04:16:55
Friday January, 2nd 2009AD
(...)
echo -e (...) \"$hour$(if let $(echo ${sec:1:2})%2==0 ; then echo : ; else echo \ ; fi )$min$(if let $(echo ${sec:1:2})%2==0 ; then echo : ; else echo \ ; fi)$sec\" \"$wkday $mnth, $(if let ${day:0:1}!=0 ; then echo $day ; else echo ${day:1:2} ; fi)$(if let ${day:1:2}==1 ; then echo st ; elif let ${day:1:2}==2 ; then echo nd ; else echo th ; fi) ${year}AD (...) > /path/to/a/named/pipeReturn to System configuration
Users browsing this forum: No registered users and 0 guests