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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to validate a date input format rajugp1 Shell Programming and Scripting 2 02-02-2009 02:16 PM
passing an input parameter like date thru jcl using BPXBATCH utility Sujatha Gowda SUN Solaris 0 06-03-2008 09:23 AM
awk/input parameter wannalearn Shell Programming and Scripting 3 07-30-2007 02:42 PM
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 10:37 PM
Shell script with input parameter jhmr7 UNIX for Dummies Questions & Answers 1 07-13-2005 01:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-12-2006
mpang_ mpang_ is offline
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!
  #2 (permalink)  
Old 04-12-2006
JunkYardWars JunkYardWars is offline
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0