calling another script if it's contains SUCCESSFULL how?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting calling another script if it's contains SUCCESSFULL how?
# 1  
Old 10-27-2011
calling another script if it's contains SUCCESSFULL how?

Hi all,

i'm a newbie here, I'm just wondering how can i call my second script if it's contain successfull.

script1.sh
how can i call my 2nd script if he contain SUCCESSFULL

script2.sh
SUCCESSFULL


please advise,

Thanks,
# 2  
Old 10-27-2011
Quote:
how can i call my 2nd script if he contain SUCCESSFULL
Contain SUCCESSFUL ??!! Are you grepping this text in script2.sh or doing some other stuff ??
# 3  
Old 10-27-2011
sorry not contain.. ^^.

let's say the output of my 2nd script is SUCCESS. if the output is SUCCESS then i'm going to call my 2nd script in my 1st script.
# 4  
Old 10-27-2011
Code:
[ `first.script|grep "SUCCESS"|wc -l ` -gt 0 ] && second.script

This User Gave Thanks to rdcwayx For This Post:
# 5  
Old 10-27-2011
thank you sir rdcwayx.

i'm just wondering if it's ok for you to explain your code?

THanks,
# 6  
Old 10-27-2011
above script is same as below
Code:
if [ `first.script|grep "SUCCESS"|wc -l ` -gt 0 ]    # if find SUCCESS from the output, calculate it, if more than 0, that's mean, find it.
  second.script
fi

# 7  
Old 10-27-2011
oic...thank you very much Sir rdcwayx.. i'm going to try it now.

THanks,

---------- Post updated at 06:02 PM ---------- Previous update was at 06:01 PM ----------

if find SUCCESS from the output of my 2ndscript right?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trigger email from script if the Special Character replacement is successfull

Hello Gurus, I have a script developed... #!/bin/bash #--------------------------------------------------------------------- # This pScript will remove/replace the special characters fromfiles #--------------------------------------------------------------------- trxdate="`date... (1 Reply)
Discussion started by: nanduedi
1 Replies

2. Shell Programming and Scripting

trying to run this script from unix but the script is not successfull

Hi I am trying to run the below unix script in informatica comamnd task the script is in placed in the path (this script checks if the files are present in other server ) ------------------------------------------------------------------... (1 Reply)
Discussion started by: laxmi131
1 Replies

3. UNIX for Advanced & Expert Users

SFTP was successfull but got return code as 1

Hi, I am using SFTP for transferring files to remote server. Below is the snipped i am using for my sftp program echo "lcd $i_localdir">/tmp/sftp_Batch echo "cd $i_destdir">>/tmp/sftp_Batch echo "put $i_filename">>/tmp/sftp_Batch echo "chmod 644... (2 Replies)
Discussion started by: Ankgne
2 Replies

4. Shell Programming and Scripting

Exit for loop in a shell script if a condition is successfull

Hi All, I am stuch in a script where a for loop is running to execute some commands for some values. Now my problem is i have to have an if condition that if the first iteration is successful then it has to exit the for loop otherwise it has to continue normally. my code is this: for... (5 Replies)
Discussion started by: usha rao
5 Replies

5. Shell Programming and Scripting

to find whether update query is successfull or not using Ksh Script

i have a script that performes an update operation. I just wanted to know whether that update statement is successfull or not. Below the script: #!/bin/ksh . $HOME/conf/systemProperties/EnvSetup.properties sqlplus -silent sie/da@edn.world <<END set pagesize 0 feedback off verify off... (3 Replies)
Discussion started by: ali560045
3 Replies

6. Shell Programming and Scripting

Script not successfull in cron

Hi, I have a script to FTP the files to other unit. Manually this script is running fine & files are getting transferred. But running the same script using crontab does not transfer files, although the cron log shows that the file was executed. PLz suggest (2 Replies)
Discussion started by: sandeep_kmehra
2 Replies

7. UNIX for Advanced & Expert Users

login partiallly successfull

Hi, I tried logging into a UNIX system with appropriate logins.. It takes lot of time to show prompt.. when i press control C it gives me the prompt.. I observed that the .cshrc file not getting executed successfully.. when i try myself sourcing .cshrc file it doesnot do it... Please let me... (1 Reply)
Discussion started by: shafi2all
1 Replies

8. HP-UX

How to check sqlplus command is successfull or not in HP UX?

Hi All, I am not able to check the output of sqlplus command if it fails. can any body please help me in this regard. (5 Replies)
Discussion started by: plaban.rout
5 Replies

9. UNIX for Dummies Questions & Answers

check for successfull telnet session

In either case using ksh or tcl, how can I check that I have a successfule telnet session and am being prompted with a tacacs login prompt ? :confused: DOIT () { sleep 2 echo "<tacacs name >" sleep 1 echo "<password>" echo "en" sleep 1 echo "<enable password>" echo "term length 512"... (0 Replies)
Discussion started by: sumguy
0 Replies

10. Shell Programming and Scripting

Detecting a successfull FTP connection

I have a question. My company has to send a file to another company. The cron script currently just sends the file. However, every now and then the other companies ftp server is down. I wanted to alter my script to detect if the server is up before I attempt to send the file. My idea follows #... (2 Replies)
Discussion started by: beilstwh
2 Replies
Login or Register to Ask a Question