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
exec JamesByars UNIX for Advanced & Expert Users 5 12-30-2007 03:35 PM
find and exec big123456 UNIX for Advanced & Expert Users 2 01-02-2006 12:10 PM
Multiple exec command s in a script Angoss Shell Programming and Scripting 2 06-29-2003 12:32 PM
exec Nisha Shell Programming and Scripting 1 09-23-2002 06:56 AM
difference between source, exec and ./script 98_1LE UNIX for Dummies Questions & Answers 1 04-15-2001 10:24 AM

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-12-2008
jayjabour jayjabour is offline
Registered User
  
 

Join Date: May 2008
Posts: 7
using -exec in a script

I am using a third party job management program called Autosys. the command to load a jil into the autosys database is jil < somefilename.jil
I have a directory and it in are a lot of jils. rather than type jil < somefilename.jil for every file I would like to script something do do it. if cd to the dir and run the following command:
fin . -name "*.jil" -exec rm {} \;
it removes every .jil file in the dir. So with that rational i tried running this command to load the jil's:
find . -name "*.jil" -exec jil < {} \;
I figured it would perform jil < ...... for every .jil file in the dir, but it came back with this error:
A file or directory in the path name does not exist.
ksh: {}: 0403-016 Cannot find or open the file.
any ideas what I am doing wrong?
  #2 (permalink)  
Old 05-12-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,813
try this or you can try xargs:

Code:
find . -name '*.jil' -type f | \
while read file 
do
       jil < $file
done

  #3 (permalink)  
Old 05-12-2008
jayjabour jayjabour is offline
Registered User
  
 

Join Date: May 2008
Posts: 7
wow, that worked. Thanks a lot. you really helped out a jr.jr.jr admin
Closed Thread

Bookmarks

Tags
autosys

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 07:04 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