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
DWWW-CONVERT(8) 						      Debian							   DWWW-CONVERT(8)

NAME
dwww-convert - convert files to HTML for dwww SYNOPSIS
dwww-convert [--no-path-info] type location DESCRIPTION
dwww-convert is part of the dwww package, which provides access to on-line documentation on a Debian system via WWW. dwww-convert converts documentation to HTML so that it can be viewed with a WWW browser. dwww-convert is usually run by the WWW server, but can also be run by hand. The type argument gives the type of the file, one of: file An arbitrary file; the type is guessed using simple heuristics based on the filename. dir A directory. If the directory contains the file index.html or index.htm that file will be returned. Otherwise, A listing of the files in the directory is generated. html An HTML file. The file is returned as is. man A manual page. The location is the pathname of the nroff source file. runman A manual page. The location is the name of the manual page and its section, separated by a slash. For example, the location would be intro/1 to refer to the intro(1) manual page. info An Info file. text A plain text file (using the ISO-8859-1 character set). An unknown file type is treated as text. The location argument gives the filename of the file. The name must be complete, i.e., it must start at the root directory (/). The name must not contain any symbolic links (cf. realpath(1)). The file must be located in or below a directory that has been allowed by the sys- tem administrator; see dwww(7) for more info. The file may be compressed with gzip(1) or bzip2(1). It is uncompressed automatically and invisibly. Compression is indicated by a file- name that ends in `.gz' or `.bz2'. OPTIONS
--no-path-info Internal option used by the dwww's CGI script to let dwww-convert know, that the arguments following the option do not come from the PATH_INFO variable, but from the QUERY_STRING. FILES
/etc/dwww/dwww.conf Configuration file for dwww. See dwww(7) for more information. SEE ALSO
dwww(7), dwww-txt2html(8), dwww-build(8), dwww-cache(8). AUTHOR
Lars Wirzenius. Modified by Robert Luberda. See dwww(7) for copyrights and stuff. dwww 1.11.1 February 15th, 2009 DWWW-CONVERT(8)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy