Running .sh file inside a shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running .sh file inside a shell script
# 8  
Old 02-18-2013
Yep, a cd in $ORACLE_HOME/owb/bin/unix/OMBPlus.sh
does not have an affect on the calling script (parent process),
unless it is included with
Code:
source $ORACLE_HOME/owb/bin/unix/OMBPlus.sh

or
Code:
. $ORACLE_HOME/owb/bin/unix/OMBPlus.sh

# 9  
Old 02-18-2013
Hello MaidinGermany,
I re-write my code as below, please advise if this is ok. Thanks.
Code:
#!/bin/sh -fb
cd $ORACLE_HOME/owb/bin/unix/
./OMBPlus.sh
source /app/mes_dwh/test/$plugin/$plugin/$plugin/$plugin/omb/delete_all.tcl


Last edited by Franklin52; 02-19-2013 at 04:03 AM.. Reason: Please use code tags for data and code samples
# 10  
Old 02-19-2013
Yes try it.
And also
Code:
#!/bin/sh -f
. $ORACLE_HOME/owb/bin/unix/OMBPlus.sh
. /app/mes_dwh/test/$plugin/$plugin/$plugin/$plugin/omb/delete_all.tcl

# 11  
Old 02-19-2013
sh does not need a -f like sed and awk, and in fact it affects globbing, -b is only effective interactively, when there is job control, but sometimes we put in a -x for debug to see what it is doing.


-f Disable pathname expansion.


-b Report the status of terminated background jobs immediately, rather than before the next primary prompt. This is effective only when job control is enabled.

The effect of first line $!xxxx is a new command: xxxx "$0" "$@"

The man page for sed and awk says to run a script file use -f, but for sh it says just put it on the command line.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sqlplus inside shell script writing to tmp file

Hi, facing an issue while calling sqlplus inside shell script. It for some reason goes to tmp file to write something and i get error as permission denied as i dont have access there. ANy idea why sqlplus writes in /tmp and how to change or stop this ? (2 Replies)
Discussion started by: rushikeshs
2 Replies

2. Shell Programming and Scripting

Calling a function in cpp file inside shell script

Hi I need to call a function written in a cpp file with arguments inside the shell script..Can anyone help me how to do this:( (1 Reply)
Discussion started by: rkrish
1 Replies

3. Shell Programming and Scripting

Linux Shell Script to check for string inside a file?

This is what I have so far grep -lir "some text" * I need to check all files on the system for this text, if the text is found I need to change the file permissions so only ROOT has read and write access. How can this be done? (3 Replies)
Discussion started by: mapleleafs89
3 Replies

4. Shell Programming and Scripting

help in running while loop inside a shell script

I have an input file at ./$1.txt with content of seq numbers like : 1234567890 1234589700 . . so on.. I need to take each seq nbr from the input file ,run the query below: select ackname,seqnbr from event where event_text like '%seqnbr( from the input file)' and redirect the... (11 Replies)
Discussion started by: rkrish
11 Replies

5. Shell Programming and Scripting

Making file inside shell script

Hi, i have written a shell script and its working fine till now. Now, i have to enhance it with a small updation. i need to make a file inside my file that will contain the below parameters 1) Customer_id 2) Server_id 3) No. Account All the above variables are already been taken in... (3 Replies)
Discussion started by: dazdseg
3 Replies

6. Shell Programming and Scripting

how to access variables in a config file inside a shell script

I'm writing a shell script. I want to put the variables in a separate config files and use those inside my script. e.g. the config file (temp.conf)will have the values like mapping=123 file_name=xyz.txt I want to access these variables in temp.conf(i.e. mapping and file_name) from inside the... (7 Replies)
Discussion started by: badrimohanty
7 Replies

7. Shell Programming and Scripting

how to redirect the output of a grep command to a file inside a shell script

hi, i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Discussion started by: kripssmart
11 Replies

8. UNIX for Dummies Questions & Answers

how to get the output of a grep command to a file inside a shell script

hi, i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (1 Reply)
Discussion started by: kripssmart
1 Replies

9. Shell Programming and Scripting

How to store the outputs of a shell script inside a log file???

My shell script file name is test.sh and the contents of this test.sh file are ps_file="package1.ps" echo $ps_file ps_file1=`echo $ps_file| sed "s/.ps//g"` echo $ps_file1 ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf Now i... (2 Replies)
Discussion started by: sunitachoudhury
2 Replies

10. UNIX for Dummies Questions & Answers

running sed inside script file

i am substituting some text in the xml file using sed, on shell directly it works fine, but when i run it inside script file, it say, the function cant be parsed, i think the prob is due to xml file, kindly help (4 Replies)
Discussion started by: bajaj111
4 Replies
Login or Register to Ask a Question