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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using Rename to move files snufse UNIX for Dummies Questions & Answers 1 04-09-2008 09:57 AM
How to move all files except one? Kim Walisch Shell Programming and Scripting 4 11-02-2007 01:00 PM
move files uniksbro UNIX for Advanced & Expert Users 4 07-31-2007 08:42 AM
move files ust Shell Programming and Scripting 5 07-03-2005 11:41 PM
move files mta UNIX for Dummies Questions & Answers 2 01-16-2004 09:22 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 6
how to move files

Message broker is creating multiple files on my unix box.

Files are like *.txt, *.dat, *.csv etc.

I can pass following parameters to my script,

$SourceFileDir, $TargetFileDir, $FileName.

I wrote a script which can move one files from $SourceFileDir to $TargetFileDir after assigning $FileName=abc.txt.

But how will I move multiple extension files to $TargetFileDir?

thanks
monica
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 23
try this:

Code:
 case ${FileName##*.} in
     txt|dat|csv) 
          mv $SourceFileDir/$FileName $TargetFileDir/ ;;
  esac
(Bash)

Last edited by yunccll; 03-14-2008 at 01:05 PM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0