![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Finding mail per hour | Prince2 | Shell Programming and Scripting | 2 | 05-22-2008 09:50 AM |
| generating data for 1 hour | aajan | Shell Programming and Scripting | 0 | 03-17-2008 02:59 AM |
| help in hour grep | ali560045 | Shell Programming and Scripting | 0 | 01-31-2008 12:03 AM |
| how to calculate busy hour | shary | Shell Programming and Scripting | 14 | 01-29-2008 03:04 AM |
| an hour less in 24 hour system | bobo | UNIX for Dummies Questions & Answers | 3 | 10-23-2006 08:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
set DAY=`date +%y%m%d`
set H=`date +%H` set M=`date +%M` mailx -s "$H-Mydata" myemail@mail.com<mydata I am looking to set the current hour to have 1 hour less in the subject header: For example: let's say the system time is 8 I want to have "7-Mydata" not "8-Mydata" Can some1 helps? Many thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Go into the FAQ and look for datecalc - Perderabo wrote a script to handle time/date arithmetic.
|
|
#3
|
||||
|
||||
|
let HOUR=$(date +%H)-1
echo ${HOUR} Works in korn and bash |
|
#4
|
||||
|
||||
|
Quote:
|
|
#5
|
||||
|
||||
|
Quote:
Pesky 00's if (( $(date +%H) < 1 )); then HOUR=23 else let HOUR=$(date +%H)-1 fi |
|
#6
|
|||
|
|||
|
#!/usr/bin/csh
Thanks! |
|
#7
|
||||
|
||||
|
Something like this probably.
Code:
#!/bin/csh
if( `date +%H` < 1 ) then
set HOUR=23
else
set HOUR=`date +%H`
set HOUR=`expr $HOUR - 1`
endif
echo $HOUR
|
||||
| Google The UNIX and Linux Forums |