The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-29-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
Code:
$ cat test.sh
#! /bin/ksh
a=`date +%y%m%d`
b=`TZ=CST+24 date +%y%m%d`
echo "Today is $a"
echo "Yesterday was $b"
NOTE: Command, `TZ=CST+24 date +%y%m%d` for yesterday's date I found at some thread, on the same board.

If you have GNU date avaialbe it has more powerful features.


Regards,
Tayyab