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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Numeric Validation sumesh.abraham Shell Programming and Scripting 12 08-04-2008 11:10 AM
mv Filename variable to another filename gzs553 Shell Programming and Scripting 3 04-14-2008 05:19 PM
shortcut for tar cvf - [filename] | gzip > [filename].tar.gz bcamp1973 UNIX for Dummies Questions & Answers 4 12-11-2007 05:45 PM
validation :file <filename> u263066 Shell Programming and Scripting 2 09-26-2006 04:59 AM
awk data validation shihabvk UNIX for Advanced & Expert Users 1 09-27-2005 09:55 PM

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 05-02-2006
F-1 F-1 is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 4
Question Filename Validation

I'm going through a script someone wrote and has left the company.

I've a file_name -> s31-d173-lookup-20060502111140-sr

In the ksh this is a validation :

if [[ (${file_name} = @(IG([0-9]|[0-9][0-9])-(*)-(*)-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-([0-9][0-9]|[0-9][0-9]-[0-9][0-9])-sr)) ]];

The validation for the above file_name fails. Any idea why and what is file
naming convention the validation expecting ?? Thanks.

Regards,
F1
  #2 (permalink)  
Old 05-02-2006
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
You're not too close to a match there... The name must start out something like:
IG1-this-that-
IG99-this-that-
The IG is required, then one or two digits, then a dash, then anything followed by a dash and anything followed by a dash. Next you need a long string of digits, a dash, and shorter string of digits and a dash. Next you get a choice: two digits or two digits, a dash, and two more digits. A final -sr is required.
  #3 (permalink)  
Old 05-02-2006
F-1 F-1 is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 4
Smile Thanks

I managed to figure out the required format. That is -

IG(X|XX)-ABC-ABC-XXXXXXXXXXXXXX-XXXX-(XX|XX-XX)-sr

Thanks for your time. Appreciated.

Regards,
F-1
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 09:33 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