iEntry 10th Anniversary RSS Archive

IT Management Begins With Security
SecurityProNews > Articles > Operating Systems > User Friendly Date Script
Search:
[ articles_operating_systems ]

User Friendly Date Script



A.P. Lawrence
Contributing Writer
2003-03-31

SecurityProNews: Insider Reports Insider Reports RSS Feed


Setdate

The "setdate" is just a more user-friendly front end to changing the date and time:


echo -n "Enter Date or leave blank for `date +%m/%d/%y`: " 
read mydat
echo -n "Enter Time or leave blank for `date +%H:%M`: " 
read mytime
if [ "$mydat" != "" ]
then
      mmdd=`echo $mydat | sed 's////g;s/..$//'`
      yr=`echo $mydat | sed 's////g;s/^....//'`
else
      mmdd=`date +%m%d`
      yr=`date +%y`
fi
if [ "$mytime" != "" ]
then
      newtime=`echo $mytime | sed 's/://g'`
else
      newtime=`date +%H%M`
fi
date "$mmdd$newtime$yr"





This script works on Linux, SCO and most other Unixes.

Please read this disclaimer
Copyright and reprint info



About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

More articles_operating_systems Articles

SecurityProNews: Insider Reports Insider Reports RSS Feed


Get Your Site Submitted for Free in the World's Largest B2B Directory!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

iEntry Featured Services: Jayde Member Services | Forums | Freeware | Advertise with Us

Virus Warnings

Subscribe to
SecurityProNews FREE!



[ more newsletters ]

article resources
Search Articles:
[advanced search]

WebProWorld.com
Get in-touch with industry experts and leaders
Post your site for review by expert and peers
Ask Security, IT, Development and Design questions

Free Membership: Join Now!

Visit WebProWorld.com

Titan Quest Forum
The #1 Titan Quest forum
Halo 3 Forum
The best Halo, Halo 2, Halo 3 forum
Nintendo Wii
Nintendo Wii news and views
Mac Software
The best in OS X freeware
Graphics Forum
Your source for graphic tutorials
SecurityProNews.com | Breaking eBusiness News Get Your IT Questions Answered - Click Here SecurityProNews News Feeds