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
waiting until file loaded mogabr Shell Programming and Scripting 1 08-08-2008 11:24 AM
Help shell script to loop through files update ctl file to be sql loaded dba_nh Shell Programming and Scripting 1 04-15-2008 09:00 PM
How can I make the for command check to see if a file is empty before executing? chrchcol Shell Programming and Scripting 3 07-29-2006 04:14 AM
executing *.bat file on windows from Unix box via ftp command alx Shell Programming and Scripting 9 01-29-2006 06:31 PM
executing dir or ls command via FTP alx Shell Programming and Scripting 5 01-27-2006 06:13 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-17-2009
GoldenEye4ever GoldenEye4ever is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 5
Help executing command loaded from file

I need to execute a command that is loaded from a file.

Basically, we have several scripts that need to be run at scheduled times.
We're going to store those times in the database and update a file with data.
In that file we'll have scriptName, inputParameters, runTimes, etc...
I chose to use tilda (~) as the delimiter as it can't be used by any of the input variables

I got it all working, with one exception.
If an inputParameter needs to be executed (current date `date +'%d%m'`)

Then I get this error:

Code:
./chk_master_script.sh[247]: `date +%m%d`:  not found
Launching script (with parameters): $HOME/daily/scripts/workit.sh

This is roughly how I load the data:

Code:
if [ -s ${masterDataFile} ]; then
  fileExists=true
  IFS="~"
  while read workerScript parameters timingStuff; do
    ...
    params=`${parameters}`
    echo "Launching script (with parameters): ${workerScript} ${params}"
    ...
  done

File Layout:

Code:
filename~parameters~schedulingStuffHere

Sample File Contents:

Code:
workerScript.sh~`date '+%m%d'`~stuffGoesHere

Thanks
 

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 09:19 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