The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-05-2007
ammu ammu is offline
Registered User
 

Join Date: Jul 2006
Posts: 55
checking parameter values passed to script

Hi,

I will pass 3 parameters for a script.I have to check the file name and create a new file name with time stamp.

the parameters which i'm passing are

/dir/stg/filename.txt
/dir/path/head.txt
/dir/path/tail.txt

Now i have to check filename like :

if it is a.txt i have to create a_`date '+%Y%m%d_%H%M%S'`.txt

if it is b.txt the new file should be b_`date '+%Y%m%d_%H%M%S'`.txt

How can we do this with in a script.

Thanks in advance!
Reply With Quote
Forum Sponsor