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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
CRON job to execute all scripts in a directory Annorax UNIX for Dummies Questions & Answers 6 06-22-2007 02:05 PM
I need help getting my tar.gz files to execute pgoble Linux 6 01-29-2007 10:58 AM
Can crontab execute binary files? Tris UNIX for Dummies Questions & Answers 5 12-07-2006 02:16 PM
copy files from one directory to another directory zip_zip UNIX for Dummies Questions & Answers 5 09-14-2003 07:16 PM
moving files from a unix directory to a windows directory gleads UNIX for Dummies Questions & Answers 2 08-29-2002 09:42 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-31-2007
nagomes nagomes is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 5
Smile I do I execute several files in a directory

I have a directory with several files with commands inside:

file1
file2
file3
...
file n

I want to make a script that will execute the commands in this files one by one and move the files to another directory.
When there is no more files in the directory the script ends.

Can you help?

Thanks
  #2 (permalink)  
Old 05-31-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Nagomes,
See if this works for you:

Code:
for mFile in file*
do
  $mFile
  mv $mFile <new_directory>
done

  #3 (permalink)  
Old 06-08-2007
nagomes nagomes is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 5
Can you explain better?
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 11:14 AM.


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