Sponsored Content
Top Forums Shell Programming and Scripting Validating the input date format Post 302220202 by Sharmila_P on Thursday 31st of July 2008 06:05:38 AM
Old 07-31-2008
Validating the input date format

I have one script.for that the inputs are fromdate(dd/mon/yyyy) and todate(dd/mon/yyyy).
How i can validate the input format?for eg.27/08/2008 is not valid.27/aug/2008 or 27/Aug/2008 are valid.
and the todate is optional.so if the todate is not present in the input then i need to assign the current date as the
todate in the format-dd/mon/yyyy.how to do this.
 

10 More Discussions You Might Find Interesting

1. Programming

validating input

how do i validate y script so that it only accepts values between 1 and 3 and against any character input, cause at the moment i can only validate against numbers outside 1 and 3 but not characters cheers (4 Replies)
Discussion started by: ruffenator
4 Replies

2. Shell Programming and Scripting

validating input using regular expressions

I am trying to validate input from the user in a script. I thought is was easy to do using regular expressions but I can't figure out how to use REs in a conditional. I have tried using grep from a temp file, sed from a temp file, sed from command line, comparison in an if condition and I cannot... (1 Reply)
Discussion started by: nrodolfich
1 Replies

3. Shell Programming and Scripting

Validating user input is not blank

Trying to create a script in BASH that would ask the user to enter another user name making sure the input is not blank before they hit enter then to check the home directory of that user does exist, I have the check folder sorted it's just the loop to make sure the user has entered chars (5 Replies)
Discussion started by: MBN
5 Replies

4. Shell Programming and Scripting

validating a input file for numeric and character

i have a input file like this 001|rahim|bajaj|20090102 while reading the file i need to check whether the first column is a number second column is a name is there any methodology to check for the same thanks in advance (2 Replies)
Discussion started by: trichyselva
2 Replies

5. Shell Programming and Scripting

Need to validate a date input format

Hi all, I have a shell script(K shell) which takes a date as input. i want the input to be in DD-MM-YYYY format. Can i enforce such a format of input string using just one line of code? OR do i need to parse the input date into different components and test them using Case statements... (2 Replies)
Discussion started by: rajugp1
2 Replies

6. UNIX for Dummies Questions & Answers

Validating input based on fixed number of fields

Yes, i did... let me state my problem in more detail Inputs: I have one input CSV file And, i have stored no. of comma each line should in a variable. e.g. $ cat cmt.csv this, is a ,comma ,count test1 ,,this, is a ,comma ,count test2 this, is a ,comma ,count test3... (6 Replies)
Discussion started by: Dipali
6 Replies

7. Shell Programming and Scripting

Validating Input parameters

Hi All, I have tried to use ckdate (sun) command in script. It checks the input parameter which should be in 'YYYYMMDD format. date=$( echo $1 | ckdate -f "%Y%m%d") | true if ] then print " success" else print "no success" fi But in whatever format i pass the parameter,... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies

8. UNIX for Dummies Questions & Answers

Validating user input

I'm trying to set up a script that takes user input and validates that the user input was entered correctly. So far I have this: while : do echo "Please enter your name." read NAME if then echo "You have not entered a name." echo... (13 Replies)
Discussion started by: fufaso
13 Replies

9. Shell Programming and Scripting

Check input date format?

how to check input date format. for example $input_date must be in format dd.mm.gg script is execute like this: bin/script1.sh 14.12.2009 script1.sh code: #!/bin/sh input_date=$1 CMD="/app/si/test/test.sh $input_date" echo "*****" $CMD (2 Replies)
Discussion started by: waso
2 Replies

10. Shell Programming and Scripting

Validating date in yyyymmdd format using PERL

Hi all, i had a code where in user will enter a date in yyyymmdd format.. i didnt use any validation for the date and now the problem is if a user enters date instead of month after year it is proceeding with the code.. like if the date is 20120426 and if the user enters 20122604 it... (4 Replies)
Discussion started by: smarty86
4 Replies
DateTime::Locale::da(3) 				User Contributed Perl Documentation				   DateTime::Locale::da(3)

NAME
DateTime::Locale::da SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'da' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Danish. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) mandag tirsdag onsdag torsdag fredag lordag sondag Abbreviated (format) man tir ons tor fre lor son Narrow (format) M T O T F L S Wide (stand-alone) mandag tirsdag onsdag torsdag fredag lordag sondag Abbreviated (stand-alone) man tir ons tor fre lor son Narrow (stand-alone) M T O T F L S Months Wide (format) januar februar marts april maj juni juli august september oktober november december Abbreviated (format) jan. feb. mar. apr. maj jun. jul. aug. sep. okt. nov. dec. Narrow (format) J F M A M J J A S O N D Wide (stand-alone) januar februar marts april maj juni juli august september oktober november december Abbreviated (stand-alone) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. kvartal 2. kvartal 3. kvartal 4. kvartal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide f.Kr. e.Kr. Abbreviated f.Kr. e.Kr. Narrow f.Kr. e.Kr. Date Formats Full 2008-02-05T18:30:30 = tirsdag den 5. februar 2008 1995-12-22T09:05:02 = fredag den 22. december 1995 -0010-09-15T04:44:23 = lordag den 15. september -10 Long 2008-02-05T18:30:30 = 5. feb. 2008 1995-12-22T09:05:02 = 22. dec. 1995 -0010-09-15T04:44:23 = 15. sep. -10 Medium 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Time Formats Full 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = tirsdag den 5. februar 2008 18.30.30 UTC 1995-12-22T09:05:02 = fredag den 22. december 1995 09.05.02 UTC -0010-09-15T04:44:23 = lordag den 15. september -10 04.44.23 UTC Long 2008-02-05T18:30:30 = 5. feb. 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22. dec. 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15. sep. -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 05/02/2008 18.30.30 1995-12-22T09:05:02 = 22/12/1995 09.05.02 -0010-09-15T04:44:23 = 15/09/-010 04.44.23 Short 2008-02-05T18:30:30 = 05/02/08 18.30 1995-12-22T09:05:02 = 22/12/95 09.05 -0010-09-15T04:44:23 = 15/09/-10 04.44 Default 2008-02-05T18:30:30 = 05/02/2008 18.30.30 1995-12-22T09:05:02 = 22/12/1995 09.05.02 -0010-09-15T04:44:23 = 15/09/-010 04.44.23 Available Formats d (d.) 2008-02-05T18:30:30 = 5. 1995-12-22T09:05:02 = 22. -0010-09-15T04:44:23 = 15. EEEd (d EEE) 2008-02-05T18:30:30 = 5 tir 1995-12-22T09:05:02 = 22 fre -0010-09-15T04:44:23 = 15 lor H (H) 2008-02-05T18:30:30 = 18 1995-12-22T09:05:02 = 9 -0010-09-15T04:44:23 = 4 HHmmss (HH.mm.ss) 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Hm (HH.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 hm (h.mm a) 2008-02-05T18:30:30 = 6.30 e.m. 1995-12-22T09:05:02 = 9.05 f.m. -0010-09-15T04:44:23 = 4.44 f.m. Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h.mm.ss a) 2008-02-05T18:30:30 = 6.30.30 e.m. 1995-12-22T09:05:02 = 9.05.02 f.m. -0010-09-15T04:44:23 = 4.44.23 f.m. M (M) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (E. d-M) 2008-02-05T18:30:30 = tir. 5-2 1995-12-22T09:05:02 = fre. 22-12 -0010-09-15T04:44:23 = lor. 15-9 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (MMM) 2008-02-05T18:30:30 = feb. 1995-12-22T09:05:02 = dec. -0010-09-15T04:44:23 = sep. MMMd (d. MMM) 2008-02-05T18:30:30 = 5. feb. 1995-12-22T09:05:02 = 22. dec. -0010-09-15T04:44:23 = 15. sep. MMMEd (E d MMM) 2008-02-05T18:30:30 = tir 5 feb. 1995-12-22T09:05:02 = fre 22 dec. -0010-09-15T04:44:23 = lor 15 sep. MMMMd (d. MMMM) 2008-02-05T18:30:30 = 5. februar 1995-12-22T09:05:02 = 22. december -0010-09-15T04:44:23 = 15. september MMMMEd (E, d. MMMM) 2008-02-05T18:30:30 = tir, 5. februar 1995-12-22T09:05:02 = fre, 22. december -0010-09-15T04:44:23 = lor, 15. september ms (mm.ss) 2008-02-05T18:30:30 = 30.30 1995-12-22T09:05:02 = 05.02 -0010-09-15T04:44:23 = 44.23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (M-yyyy) 2008-02-05T18:30:30 = 2-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 9--010 yMEd (EEE. d-M-yyyy) 2008-02-05T18:30:30 = tir. 5-2-2008 1995-12-22T09:05:02 = fre. 22-12-1995 -0010-09-15T04:44:23 = lor. 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = feb. 2008 1995-12-22T09:05:02 = dec. 1995 -0010-09-15T04:44:23 = sep. -10 yMMMEd (EEE. d. MMM y) 2008-02-05T18:30:30 = tir. 5. feb. 2008 1995-12-22T09:05:02 = fre. 22. dec. 1995 -0010-09-15T04:44:23 = lor. 15. sep. -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = februar 2008 1995-12-22T09:05:02 = december 1995 -0010-09-15T04:44:23 = september -10 yQ (Q yyyy) 2008-02-05T18:30:30 = 1 2008 1995-12-22T09:05:02 = 4 1995 -0010-09-15T04:44:23 = 3 -010 yQQQ (QQQ y) 2008-02-05T18:30:30 = K1 2008 1995-12-22T09:05:02 = K4 1995 -0010-09-15T04:44:23 = K3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyMMM (MMM yy) 2008-02-05T18:30:30 = feb. 08 1995-12-22T09:05:02 = dec. 95 -0010-09-15T04:44:23 = sep. -10 yyQ (Q. 'kvartal' yy) 2008-02-05T18:30:30 = 1. kvartal 08 1995-12-22T09:05:02 = 4. kvartal 95 -0010-09-15T04:44:23 = 3. kvartal -10 yyyy (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yyyyMM (MM/yyyy) 2008-02-05T18:30:30 = 02/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 09/-010 yyyyMMM (MMM y) 2008-02-05T18:30:30 = feb. 2008 1995-12-22T09:05:02 = dec. 1995 -0010-09-15T04:44:23 = sep. -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week mandag SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::da(3)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy