The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing an input parameter like date thru jcl using BPXBATCH utility Sujatha Gowda SUN Solaris 0 06-03-2008 05:23 AM
awk/input parameter wannalearn Shell Programming and Scripting 3 07-30-2007 10:42 AM
how do I make dynamic parameter names? Or get the value of a parameter evaluated twi Awanka Shell Programming and Scripting 2 04-19-2007 06:37 PM
Shell script with input parameter jhmr7 UNIX for Dummies Questions & Answers 1 07-12-2005 09:04 PM
Need to validate a date input format rajugp1 Shell Programming and Scripting 1 12-05-2002 07:12 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-11-2006
Registered User
 

Join Date: Mar 2006
Posts: 89
Input parameter format

Hi,

My script expects 2 inputs and one of them is supposed to be time, I would like to check if the given input is in validate format (i.e. 16:00), could anyone help me out here? thanks!
Reply With Quote
Forum Sponsor
  #2  
Old 04-12-2006
Registered User
 

Join Date: Mar 2006
Location: Gurgaon
Posts: 26
This is the prelim and u will have to look for tighter time checking ..but thats the start....
#! /bin/ksh
input=$1
echo $input
if [[ $input = [0-2][0-9]:[0-6][0-9] ]]
then
echo "Correct input"
else
echo "Incorrect input"
fi
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0