script returns prompt

Thread Tools Search this Thread
# 1  
script returns prompt


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':')
echo Instance $instance is in the oratab

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?

# 2  
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  
AIX 4.3.3

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

Thanks a bunch,
# 4  
I never noticed that we could do that. But I tried:
echo $?
and got a 1. Then I tried:
! false
echo $?
and I got a 0. Very interesting.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #493
Difficulty: Medium
When a program executes, each command executes one after the other, top-to-bottom. This is known as inconsequential control flow.
True or False?

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: 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. 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 #!/bin/sh `./ &` while # indefinite loop do x=5; done $ cat # 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

7. Shell Programming and Scripting

Why Does Command Run From Prompt But Not From Script?

I hope someone can shed any light on this mystery. I am trying to run the following command: su userID -c remsh server -l userid -n "awk -F^ '\$4 == \"SMITH\"' /tmp/infromational/version74b/LIVE/TEMPORARY/ABCfiles/HLC_Database_File.bat|head -1" > /tmp/variant/45BV32/var/store13.logfnd I... (15 Replies)
Discussion started by: Korn0474
15 Replies

8. 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

9. 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

10. Shell Programming and Scripting

script to change shell and prompt

I want to write a shell script which will change the current shell (say from csh to bsh) and my Prompt (say my name) as desired.pls help (1 Reply)
Discussion started by: SHYAM
1 Replies

Featured Tech Videos