how to jump a shell !!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to jump a shell !!
# 1  
Old 04-04-2011
Bug how to jump a shell !!

Hi,

can someone point out a solution to my problem below.

Within a shell script TEST.ksh I have to run two commands CmdA & CmdB one after the other as below.
-------------
TEST.ksh
#!/usr/bin/ksh
A
B
-------------

I am running this script from KSH with PID 12345 as below.

./TEST.ksh

But the command A is such that it gets launched in a new shell altogether, i.e. say with PID 56789. Now since A command has launched a new shell the command B doesn't get started untill I go and manually kill the KSH shell that A got started in, or just do an 'exit' from the current shell where I ran the TEST.ksh script.

Is there a way to run both A & B from a single script and without having to manually kill/exit the shell ???

One more thing to note here is that B has to run in the same shell as A as there is a dependancy of B on A.

Thanks,
Krishna
# 2  
Old 04-04-2011
I'm starting to feel like a broken record here.

We are not psychic specialists. Please post your actual, complete code. Without that we can't tell the real source of the problem -- why A isn't completing like it should.
# 3  
Old 04-04-2011
Thanks for the reply. here is the code.

-----------------------------
Code:
#!/usr/bin/ksh

Load clearcase
cleartool setview j999999
$HOME/test.ksh

-----------------------------

The cleartool command gets launched in a new shell and the control doesn't go to the test.ksh untill I exit from current shell. I wanted to know if I can run test.ksh as well in the same shell that cleartool runs in ?

Also just to demonstrate the behaviour or the cleartool command I ran it from command prompt for your reference.
Code:
> ps|grep $$
13727 pts/57   0:00 ksh
> cleartool setview j965155_edg
> ps|grep $$
21081 pts/57   0:00 ksh


Last edited by Franklin52; 04-04-2011 at 02:17 PM.. Reason: Please use code tags
# 4  
Old 04-04-2011
Google is your friend.
# 5  
Old 04-04-2011
See if this works for you:
Code:
{ cleartool setview j999999 ; $HOME/test.ksh ; }

# 6  
Old 04-04-2011
ThanQ

Thanks Guys, it worked for me Smilie !!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

jump to a section in output

HI I have the following output from an autosys command . Now I would like to investigate further .i.e Start Dependent Job Name Status ... (3 Replies)
Discussion started by: ptappeta
3 Replies

2. Shell Programming and Scripting

Jump to next element in a loop

Hi, i want the loop to move to 3rd item, when it encounters 2 while runing for i in 1 2 3 4 5 6 do if then #jump to element 3 else echo $i fi done o/p 1 3 4 5 6 (4 Replies)
Discussion started by: sam05121988
4 Replies

3. Solaris

Jump Start vs Flash Archive

Hi I'm trying to understand the difference between installation methods of Solaris 10, Jump Start vs Flash Archive ? thx for help. (6 Replies)
Discussion started by: presul
6 Replies

4. Shell Programming and Scripting

[bash] jump from one txt file to another

Hi all, I need to create a bash script that reads a txt file on a remote (Windows 2003) server, gets the IP-addresses out of it and then fetches the folders to copy out of another txt file. (all files are auto-generated) The IP addresses that don't have a folder_list file should be ignored. At... (31 Replies)
Discussion started by: laurens
31 Replies

5. AIX

jump in a .KSH batch

hi everyone, i need to know if is that possible insert in a batch KSH a "GO TO" sentence to jump at the top or at the end of the job. e.g. top: step1 step2 go to top: thanks in advance (4 Replies)
Discussion started by: enge
4 Replies

6. Shell Programming and Scripting

help - script can check jump sequence?

Hi, if I have a lot of files like (AABBCC0010, AABBCC0011, AABBCC0012....AABBCC1000), can I write a small script to check any sequence number jump and show me the result which sequence number? #The first sequence may start from 0010 or 0101... :confused: Thank you!! (10 Replies)
Discussion started by: happyv
10 Replies

7. Shell Programming and Scripting

Jump to a specific place in a file?

If I cat a file And want to go to the first instance of a particular value - what command would I use? And then from that point where I jumped to search for another value - but only search from that point forward not before the file? Thanks~ (2 Replies)
Discussion started by: llsmr777
2 Replies

8. Shell Programming and Scripting

checking jump sequence number (part2)

The following script have some bug...can you all help me: #!/bin/sh start=1 for file_number in `ls -1 /appl/CH_DATA/archive/list1/CACHE/CDBACKUPFILEJohn*.archived | sort | cut -c 48,49,50,51` do if ; then # this is the first pass of the loop, so we've got nothing to compare start=0... (3 Replies)
Discussion started by: happyv
3 Replies

9. UNIX for Dummies Questions & Answers

Knoppix ---> Slackware the big jump, should I?

yea, I'm a really dummie, I have been using Knoppix for a while on a bootable disk, but wanting to switch to Slackware, is this a good decision? could any of you link me to a slackware downloadable site? thanks -Jace:D (7 Replies)
Discussion started by: Jace
7 Replies
Login or Register to Ask a Question