The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
list the files but exclude the files in subdirectories shyjuezy UNIX for Dummies Questions & Answers 8 10-15-2008 01:42 PM
How to copy specified files from list of files from dir A to dir B pmeesara Shell Programming and Scripting 3 09-29-2008 03:40 PM
How list of files apart from *.class files in certain folder itsjoy2u Shell Programming and Scripting 3 09-04-2008 10:28 AM
scp list of files nmahendran Shell Programming and Scripting 1 09-03-2008 08:09 AM
counting a list of string in a list of txt files Pep Puigvert UNIX for Dummies Questions & Answers 4 08-15-2008 03:55 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-24-2008
Registered User
 

Join Date: Sep 2008
Posts: 34
How to get a list of files?

Hi,

That should be an easy one:

How to get all of the files names out of the given directory which are in given format?

vendor_source_object_date_filenum.txt

vendor: constant
source: input parameter
object: predefined list ( customer, mail_addredss, email-address, telephone...)

date: YYYYMMDDHHMMSS
filenum: sequence number of fiel (1,2,3...)

Thanks
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-24-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,293
Question Can you show some samples?

Problems where the request is to select based on a criteria are best when example input and output is shown. Can you list filenames in the folder, and include the good and bad ones (for selecting)?
Reply With Quote
  #3 (permalink)  
Old 10-24-2008
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,453
... and it depends largely on the shell you are using.
Reply With Quote
  #4 (permalink)  
Old 10-24-2008
Registered User
 

Join Date: Sep 2008
Posts: 34
Not sure, what you mean.

Bad one:
bad_file.txt

Good one:
LM_CM_TELEPHONE_20081024114245_1.txt
Reply With Quote
  #5 (permalink)  
Old 10-24-2008
Registered User
 

Join Date: Sep 2008
Posts: 34
It is korn shell for sure and ksh93 probably, but not 100% sure.
and her's another question is there way to check what version of shell is using?
Reply With Quote
  #6 (permalink)  
Old 10-24-2008
Registered User
 

Join Date: Sep 2008
Posts: 34
Quote:
Originally Posted by joeyg View Post
Problems where the request is to select based on a criteria are best when example input and output is shown. Can you list filenames in the folder, and include the good and bad ones (for selecting)?
Predefined :
dir=$DATA_PATH
vendor='LM' ( constant )
date: any valid date ( for now)

So input is : source

Output is : the list of files to use in FOR loop to process. (LM_CM_TELEPHONE_20081024114245_1.txt)

Last edited by Leo_NN; 10-24-2008 at 11:57 AM..
Reply With Quote
  #7 (permalink)  
Old 10-24-2008
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,453
Quote:
Originally Posted by Leo_NN View Post
It is korn shell for sure and ksh93 probably, but not 100% sure.
and her's another question is there way to check what version of shell is using?
Yes. If the command below does not return an error, you have ksh93:

Code:
print ${.sh.version}
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 07:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66