script returns prompt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers script returns prompt
# 1  
Old 10-06-2003
script returns prompt

Hi,

I am trying to create a script that will loop through my oratab file and pull out the instance name.

Here is script:

for instance in $(cat /etc/oratab|egrep ':N|:Y'|grep -v \*|grep -v \#|cut -f1 -d':')
do
echo Instance $instance is in the oratab
echo $ORACLE_HOME
done

From what I can tell, it starts another process, why? Then it returns my prompt with no echo output to screen. Then I have to kill the process, now my output shows up after its killed.

What am I missing here?

Thanks,
Kathy
# 2  
Old 10-06-2003
What os are you using? What is your login shell? What command are you using to run your script?

Ideally, your first line should be something like:
#! /usr/bin/ksh
or something like that. Whether or not your script should be able to work without it depends on the answers to the above questions.
# 3  
Old 10-06-2003
AIX 4.3.3
ksh

Its working, now. I was missing the #
in the #! /usr/bin/ksh.

Thanks a bunch,
Kathy
# 4  
Old 10-06-2003
I never noticed that we could do that. But I tried:
false
echo $?
and got a 1. Then I tried:
! false
echo $?
and I got a 0. Very interesting.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Unable to move from rsc prompt to ok prompt

Hi, on sunfire v890 unable to move from rsc prompt to ok prompt, i have executed the command break. (9 Replies)
Discussion started by: manoj.solaris
9 Replies

2. UNIX for Dummies Questions & Answers

Nohup not returns to the prompt

Hi i have a script and i ma running that via nohup and &. I am expecting that to return to the user prompt immediately. But it's not returning and returns only after i press ctrl+c. i am invoking the script as follow as : nohup ./script args & $ nohup: appending output to `nohup.out' ... (4 Replies)
Discussion started by: pandeesh
4 Replies

3. Shell Programming and Scripting

Awk script returns nothing

HSLIST=$1 LFILE=$2 STRING=$3 awk 'BEGIN { while((getline < "'${HSLIST}'")>0) S FS="\n"; RS="}\n" } /servicestatus {/ && /service_description='${STRING}'/ { for(X in D) delete D; for(N=2; N<=NF; N++) { split($N, A, "="); (4 Replies)
Discussion started by: SkySmart
4 Replies

4. Shell Programming and Scripting

Python call to bash script returns empty string

Hi all, I need help figuring out why my script won't work when envoked from web interface. First off, I'm fairly new to Linux and Shell scripting so, my apologies for being ignorant! So I have a python script that I envoke through a web interface. This script envokes my shell script and... (8 Replies)
Discussion started by: arod291
8 Replies

5. Shell Programming and Scripting

Execution of shell script returns error 127

Hi All, While running shell script i got following output. interpreter "usr/bin/ksh" not found sh: step1.sh: not found. ldnhpux | oracle >echo $? 127 - Running command "which ksh" retruns "usr/bin/ksh". - I found some information on web stating to remove extra carriage return chars,... (8 Replies)
Discussion started by: RuchirP
8 Replies

6. Shell Programming and Scripting

Shell Script to prompt customer for name etc

How do I create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, product, price range. Thanks (1 Reply)
Discussion started by: SQLScript
1 Replies

7. AIX

Command behaves different in script and on prompt

$cat /tmp/tuxob.lst udi ***** jim 10 ant 19 ibm ***** $ input=`head -1 /tmp/tuxob.lst | awk '{print $NF}'` $ echo $input The output I am expecting is '*****'. But It is showing me the available files of current directory. When I run the command head -1 /tmp/tuxob.lst | awk '{print $NF} ... (3 Replies)
Discussion started by: panchpan
3 Replies

8. UNIX for Advanced & Expert Users

PPID differs in script and prompt

I tried several times to get answer to the below problem. Someone can please help me? $ cat p1.sh #!/bin/sh `./c1.sh &` while # indefinite loop do x=5; done $ cat c1.sh # sleep for 10 sec and exit #!/bin/sh sleep 10; Execute P1 as ./p1 & $ ps -eaf | grep c1... (1 Reply)
Discussion started by: alexalex1
1 Replies

9. Shell Programming and Scripting

FIND returns different results in script

When I execute this line at the command prompt I get a different answer than when I run it in a script? Any ideas on how to resolve? I'm trying to find all files/dir in a directory except files that start with the word file. Once I get this command to work, I will add the "delete" part to the... (6 Replies)
Discussion started by: blt123
6 Replies

10. Shell Programming and Scripting

Command prompt from within a script?

I am writing a menu script and one of the options is to access a Command Prompt and return to the menu via CTRL-D. I have tried using a loop and echoing the PS1 value, then using read to assign whatever is entered into a variable, then executing the value of that variable as a command using .... (1 Reply)
Discussion started by: sanitywonko
1 Replies
Login or Register to Ask a Question