Write a simple driver script, then use a data file to supply program name(s), data file -
use "progname -p parm1" for programs that require options.
mycontrolfile:
script
For example, $prog3 (on first line in the input file) will evaluate to "" if it is empty. So the for loop terminates early. On the second line of datafile $prog5 is "".
Thanks for the Info and I appreciate the level of detail! Looks like a great approach that I'll have to further understand and utilize when I create the scripts (I'm in design phase right now). Curious, when you say 'read data file' in the script, is that synonomous with 'read mycontrolfile'? Or are those two different things? In addition, if you state 'prog1 prog 2' etc in the script file, how does the reference to 'someprogram1', 'anotherprogram' come into play?
Hi,
i have a script 'a.sh' that should be called only by certain scripts like b.sh, c.sh
Inside a.sh, how can i determine
1) if this script was run directly from command prompt (or scheduler)
2) if called via other scripts?
Is there an easy way to get parent process name (not just pid),... (2 Replies)
I wrote a .sh script to run 5 php scripts. The problem is that it's running 1 then 2 then 3 in that order .... I want it to execute all 5 at ONCE....
nohup php /home/script1/script1.php && nohup php /home/script2/script2.php && nohup php /home/script3/script3.php && nohup php... (1 Reply)
I'm pretty new to scripting in Korn shell so please forgive me...
What I'm trying to do is to create a script that calls multiple other ksh scripts and defines variables for text files.
I need it to define my user defined variables (file paths, date & time stamps, etc that are currently in... (1 Reply)
How can I run the following command on multiple files and print out the corresponding multiple files.
perl script.pl genome.gff 1.txt > 1.gff
However, there are multiples files of 1.txt, from 1----100.txt
Thank you so much.
No duplicate posting! Continue here. (0 Replies)
How can I Run one script on multiple files and print out multiple files.
FOR EXAMPLE
i want to run script.pl on 100 files named 1.txt ....100.txt under same directory and print out corresponding file 1.gff ....100.gff.THANKS (4 Replies)
Hi Folks,
Please help me ,I need a unix shell script to check for multiple jobs running. if there are multiple backup Jobs running then it should be trigger an email .
Thanks,
Anand T (1 Reply)
I have multiple jobs and each job dependent on other job.
Each Job generates a log and If job completed successfully log file end's with JOB ENDED SUCCESSFULLY message and if it failed then it will end with JOB ENDED with FAILURE.
I need an help how to start.
Attaching the JOB dependency... (3 Replies)
Hi ,
Can someone help!
I need a shell script to run multiple scripts by using single shell script,
incase any one of the scripts fails, it should get exit and after trouble shooting if we re-execute it, it should start from the failed script.
I have a written a scripting till the... (1 Reply)
I have two scripts which I'm tying to run one after the other- this is what I've tried:
00 14 * * * /path/one.sh && /path/two.sh
I've also tried putting each script on a different line:
00 14 * * * /path/one.sh
00 14 * * * /path/two.sh
Can this be done? (1 Reply)
I have a txt file
line1
line2
line3
$!/bin/sh
cat /tmp/lus.txt | while read line
do
esxcli storage vmfs unmap -u $lin -n 4000
done
this works but does in one line at a time.
how do I do all lines at once simutaeously?
Please use CODE tags as required by forum rules! (4 Replies)
Discussion started by: tdubb123
4 Replies
LEARN ABOUT SUSE
template::plugin::datafile
Template::Plugin::Datafile(3) User Contributed Perl Documentation Template::Plugin::Datafile(3)NAME
Template::Plugin::Datafile - Plugin to construct records from a simple data file
SYNOPSIS
[% USE mydata = datafile('/path/to/datafile') %]
[% USE mydata = datafile('/path/to/datafile', delim = '|') %]
[% FOREACH record = mydata %]
[% record.this %] [% record.that %]
[% END %]
DESCRIPTION
This plugin provides a simple facility to construct a list of hash references, each of which represents a data record of known structure,
from a data file.
[% USE datafile(filename) %]
A absolute filename must be specified (for this initial implementation at least - in a future version it might also use the
"INCLUDE_PATH"). An optional "delim" parameter may also be provided to specify an alternate delimiter character.
[% USE userlist = datafile('/path/to/file/users') %]
[% USE things = datafile('items', delim = '|') %]
The format of the file is intentionally simple. The first line defines the field names, delimited by colons with optional surrounding
whitespace. Subsequent lines then defines records containing data items, also delimited by colons. e.g.
id : name : email : tel
abw : Andy Wardley : abw@tt2.org : 555-1234
sam : Simon Matthews : sam@tt2.org : 555-9876
Each line is read, split into composite fields, and then used to initialise a hash array containing the field names as relevant keys. The
plugin returns a blessed list reference containing the hash references in the order as defined in the file.
[% FOREACH user = userlist %]
[% user.id %]: [% user.name %]
[% END %]
The first line of the file must contain the field definitions. After the first line, blank lines will be ignored, along with comment line
which start with a '"#"'.
BUGS
Should handle file names relative to "INCLUDE_PATH". Doesn't permit use of '":"' in a field. Some escaping mechanism is required.
AUTHOR
Andy Wardley <abw@wardley.org> <http://wardley.org/>
COPYRIGHT
Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin
perl v5.12.1 2008-11-13 Template::Plugin::Datafile(3)