Sponsored Content
Top Forums Shell Programming and Scripting Umbrella Scripting(very Urgent) Post 302181865 by ag79 on Friday 4th of April 2008 10:37:41 AM
Old 04-04-2008
okay, for you to know whether the command was successful or not, each of the three scripts have to return come sort of code, like 0 for success and nonzero for failure.

then, you write a wrapper like this

#!/bin/sh

#Try doing "step 1" five times
step1timedout=1
for k in 1 2 3 4 5
do

#STEP 1: CONVERT XML files to PS files
convert_xml_files_to_ps.sh #replace this with your command

#get the return code
retcode=$?

#if success, break from loop
if [ $retcode -eq 0]
then
step1timedout=0
break
fi
done

#Check if step 1 timed out
if [ $step1timedout -eq 1]
then
echo "Step 1 failed to execute after 5 tries, aborting execution..."
exit 255
fi

#STEP 2: CONVERT ALL PS FILES TO PDF FILES
#repeat the code for step 1

#STEP 3: FTPING ALL PDF FILES TO THE SERVER.
#repeat the code for step 1

#end of script
exit 0

Note that this is what the script will do:
1. will try executing step 1. if it is successful, it will proceed for step 2. If step 1 fails after 5 tries, the whole script will exit.
2. Step 2 will execute with the same logic
3. Step 3 will execute with the same logic

Now if you want to repeat the whoel process in a loop, you can put the whole thing in a for loop and so it as many times as you like.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help needed in shell scripting......urgent

Dear friends, please help me to solve following problem. I'm running a frontend application from which i'll be invoking the shell script with arguments as given below -driver -w -p "ABC XYZ" -S -ds con -dn "abc xyz" i am getting $1=-driver $2=-w $3=-p $4="ABC $5=XYZ" $6=-S $7=-ds... (3 Replies)
Discussion started by: swamymns
3 Replies

2. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies

3. Shell Programming and Scripting

Please help me out:-Its Urgent-C Shell Scripting

Hi Friends, I am new to this forum as well as new to shell scripting. I have a problem here and i need someone to solve this. Let us consider there are two processes(abc & def).There is a script which kills these two processes(i.e killtheprocess abc). Here abc is the argument . There... (0 Replies)
Discussion started by: Prince89
0 Replies

4. UNIX for Advanced & Expert Users

Umbrella script

Hi All, Can anybody help me to write the umbrella script for the following? I have three steps to do. STEP 1: CONVERT XML files to PS files STEP 2: CONVERT ALL PS FILES TO PDF FILES STEP 3: FTPING ALL PDF FILES TO THE SERVER. I have the codes for the above three steps. Now I... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies

5. Shell Programming and Scripting

Urgent Korn Shell scripting Help Pleaaaase...

Hello All, Can someone help me to set a user's password from the script using korn shell. The password change is a one time password after user account creation. I tried providing the input file as the value for password field but password change requires tty so my password from an input file... (3 Replies)
Discussion started by: solaix14
3 Replies

6. Shell Programming and Scripting

it's urgent ! round number in perl scripting

my $number = 12.345673412 I need 3 digits after decimal or after dot(.) i mean , i need only 12.345 I used int(), ceil(), floor() but it gives me only 12 I need it. (10 Replies)
Discussion started by: pritish.sas
10 Replies

7. Shell Programming and Scripting

Need urgent help with PERL scripting

From the attached file I to need pick all rows that have AVG2 column value larger than 0.050, and write those values in to a separate file. Help me on how I pick the approp value & output them onto a file. Very Thanks in advance. :b: (5 Replies)
Discussion started by: tonystark
5 Replies

8. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
EBOOK-CONVERT(1)						      calibre							  EBOOK-CONVERT(1)

NAME
ebook-convert - part of calibre SYNOPSIS
ebook-convert input_file output_file [options] DESCRIPTION
Convert an ebook from one format to another. input_file is the input and output_file is the output. Both must be specified as the first two arguments to the command. The output ebook format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a directory and an "open ebook" (OEB) consisting of HTML files is written to that directory. These files are the files that would normally have been passed to the output plugin. After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option. For full documentation of the conversion system see http://calibre-ebook.com/user_manual/conversion.html Whenever you pass arguments to ebook-convert that have spaces in them, enclose the arguments in quotation marks. OPTIONS
--version show program's version number and exit -h, --help show this help message and exit SEE ALSO
The User Manual is available at http://calibre-ebook.com/user_manual Created by Kovid Goyal <kovid@kovidgoyal.net> ebook-convert (calibre 0.6.53) July 2010 EBOOK-CONVERT(1)
All times are GMT -4. The time now is 03:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy