Combining 2 scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Combining 2 scripts
# 1  
Old 12-05-2006
Combining 2 scripts

Hello I am new to shell scripting. Below are 2 scripts which I need to combine in to single script.Can some experts guide me how to proceed?


#!/bin/bash
grep "2443" /f/log/s/heduler.log | grep 2443> /tmp/memorydump

exec 6<"/tmp/memorydump"
read -u 6 data
if [ -n "$data" ]
then
echo "IN THEN" < /tmp/memorydump
fi

rm -rf /tmp/memorydump

And

#!/bin/bash
grep "Io exception: No route to host" /SSS/XX/XX/er.log | grep "Io exception: No route to host" > /tmp/memorydump

exec 6<"/tmp/memorydump"
read -u 6 data
if [ -n "$data" ]
then
mail -s "PROD." xx@.com< /tmp/memorydump

fi

rm -rf /tmp/memorydump
# 2  
Old 12-10-2006
Thanks to explain the full context of your request.
# 3  
Old 12-11-2006
Smilie
hi,
Put both of the individual scripts in single file .Then it will bcome a single script. u can run it as single script.











cheers Smilie
Ravi Raj Kumar
# 4  
Old 12-11-2006
Can you tell me how to put these 2 grep statements in a single command

grep "Io exception: No route to host" /SSS/XX/XX/er.log | grep "Io exception: No route to host" AND grep "Io exception: No route to host" /SSS/XX/XX/er.log | grep "Io exception: No route to host"
# 5  
Old 12-11-2006
with "&&" it means logical AND but only if the first statement is successful.
but I'm not sure whether it will work, I believe there is a much better solution.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combining two scripts into a single script

Hi Folks, I have two scripts that are used to start and stop services these scripts are at the location /opt/app/tre , so that start.sh internally starts the components and stop.sh internally stop all the components, now rite now if I have to stop the services then i need to go first the... (9 Replies)
Discussion started by: punpun66
9 Replies

2. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

3. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

4. Shell Programming and Scripting

Combining two shell scripts

Hi readers, I have two shell scripts running on linux machine. Both the scripts do the following task - Connect to DB - Create temp files - run select statement on table - write the rows returned on temp file Sample code is below #!/bin/sh export ORACLE_HOME=/content/oracle/10.2.0... (1 Reply)
Discussion started by: manucorbi
1 Replies

5. Shell Programming and Scripting

Combining two awk scripts

I have a file like this consisting of blocks separated by > of two number X and T > 10 0 13 5.92346 16 10.3106 19 13.9672 22 16.9838 25 19.4407 28 21.4705 31 23.1547 34 24.6813 37 26.0695 40 27.3611 43 28.631 46 29.8366 49 30.9858 52 32.0934 55 33.1458 (6 Replies)
Discussion started by: kristinu
6 Replies

6. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

7. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

8. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

9. Shell Programming and Scripting

combining two scripts

Hi , Following are the two scripts :- Script 1) #!/bin/sh cp file.log file.log.1 Script 2) #!/bin/sh diff file.log file.log.1 > DIFFERENCE.log cp file.log file.log.1 grep "ERROR" DIFFERENCE.log if ; then echo "1" else echo "0" fi (1 Reply)
Discussion started by: himvat
1 Replies

10. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies
Login or Register to Ask a Question