Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key is pressed.
Its somewhat like this :
Now if I individually run program-one , it works fine (starts some services) and then I have to press Enter key after a while to get the prompt back. So when I run the above script, it gets stuck at program-one waiting for the keypress and program-two doesnt get fired. Any idea how to come out of program-one after the service has successfully been started ?
And program-two also requires some keypress from the console like program-one so I cant put program-two before program-one.
Actually it doesnt ask for anything. Program-one will initialize some variables and call some more scripts and run a program. Basically it keeps running but you can get back to shell when you press enter.
Lemme try with your suggestion. Thanks a lot
[Edit] Okay I just researched the program-one. It assigns some variables and then runs an alias intstart which is assigned so :
This shell file intserver is the actual file which runs the service to which the users login to (a web based interface). Now when I run program-one, I do get the shell back, but then the intserver process takes over and shows its messages and I have to press Enter again to get shell back.
---------- Post updated at 07:45 PM ---------- Previous update was at 07:11 PM ----------
Hmmm .. So I added a sleep 5 after the alias is called and added a return and it seems to be working for program-one.
Now I have to fix program-two which internally calls scp and my prompt gets stuck after scp displays the privacy banner.
Last edited by DoesntMatter; 02-27-2012 at 12:33 PM..
Hello All,
I have exactly same issue @vikas_trl had in following link:
https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html
I wonder if he or somebody else could find the issue's cause or the solution.
Any help would... (4 Replies)
Hello All,
I have a UNIX script which will prepare anonymous oracle pl/sql block in a temporary file in run time and passes this file to sqlplus as given below.
cat > $v_Input_File 2>>$v_Log << EOF
BEGIN
EXECUTE IMMEDIATE 'ALTER SESSION FORCE PARALLEL DML PARALLEL 16';
EXECUTE... (1 Reply)
Hello,
I am trying to return a time multiple times from a file that has varying output just before the time instance, i.e.
cat jumped
cat jumped
cat jumped
time = 1.1
cat jumped
cat jumped
time = 1.2
cat jumped
cat jumped
time = 1.3
In this case i would like to output a time.txt... (6 Replies)
Hi,
I have a shell script which is residing on AIX which is triggered by Mainframe through Connect Direct. The shell script creates several files and sends those files to mainframe using Connect Direct. The shell script is working fine, still it is returning exit code 2 to mainframe.
What... (0 Replies)
Hey I am relatively new to Linux and shell scripting, looking for a spot of help with a script I am working on.
I am writing a script that counts the number of lines in all the files in a directory, sorts them by line number and then returns ONLY the file with the most lines.
Right now I can... (11 Replies)
Can anybody pls look into this script and tell me where I went wrong. After running this script, it is showing like "Trying to overlay current working directory ABORT!!!"
:-(
ARGCNT=$#
if
then
echo "Two parameters are needed for this shell "
echo "Please try again with... (1 Reply)
Hi,
I'm having a requirement where I need to call a C program from a shell script and return the value from the C program to shell script.
I refered a thread in this forum. But using that command in the code, it is throwing an error
clear_text_password=$(get_password)
Error: bash:... (24 Replies)
Hi everybody,
I have a script in which I'm invoking another script which runs in a subshell.
after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Hi,
Iam calling a C program from a Unix shell script. The (C) program reads encrypted username/password from a text file , decrypts and returns the decrypted string.
Is there any way i can return the decrypted string to Unix shell program.
My shell script uses the output of the program to... (11 Replies)
I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process.
I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)