Re: Executing a command in sub-shell
From: udayan (udayan_singh_at_lko.tcs.co.in)
Date: 02/11/04
- Next message: Barry Margolin: "Re: scp problems"
- Previous message: Alexis Huxley: "Re: A telephone number database system."
- In reply to: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Next in thread: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Reply: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Feb 2004 00:34:07 -0800
Kevin Rodgers <ihs_4664@yahoo.com> wrote in message news:<40292020.7050703@yahoo.com>...
> udayan wrote:
>
> > Kevin Rodgers <ihs_4664@yahoo.com> wrote in message news:<4027FEC1.4000308@yahoo.com>...
> >>cleartool setview view_name <<- _EOF
> >> command_v_1
> >> ...
> >> command_v_N
> >> _EOF
> >>cleartool setact activity_name <<- _EOF
> >> command_a_1
> >> ...
> >> command_a_N
> >> _EOF
> >>
> >>Note that the leading whitespace must be a TAB character.
> >>
> >>If the second cleartool command has to be run within the shell spawned
> >>by the first cleartool command, you'll need to nest them like this:
> >>
> >>cleartool setview view_name <<- _setview
> >> command_v_1
> >> ...
> >> command_v_N
> >> cleartool setact activity_name <<- _setact
> >> command_a_1
> >> ...
> >> command_a_N
> >> _setact
> >> _setview
> >>
> >
> > thanks a lot, learned some new stuff, but it hsant solved my problem.
> > i've stated my problem in my answer to carlos's reply.
>
> No, you haven't. What does the above actually do? By using a here document,
> the cleartool subshells receive an EOF which is effectively the same as the exit
> builtin. But you could try putting an exit command just before each EOF symbol.
Well i've again posted a reply to carlos's reply.
Now from the code that you told me -
<snip>
> >>cleartool setview view_name <<- _setview
> >> command_v_1
> >> ...
> >> command_v_N
> >> cleartool setact activity_name <<- _setact
<snip>
After this point i should be into the command prompt and not execute
the code further (till i type exit from the command prompt).
Only when i type exit from the command prompt then i should go into
the sub-shell created by "cleartool setview view_name".
Apart from above mentioned, I am not able to understand the behaviour
mentioned below -
###########Code -
#!/bin/sh
MY_NAME="UDAYAN"
cleartool setview usingh_dev_view <<- _setview
echo "my view is usingh_dev_view "
cleartool pwv
cleartool setact Tools <<- _setact
val1=0
echo "val1 = ${val1}"
echo ${MY_NAME}
_setact
cleartool pwv
_setview
echo "val1 = ${val1}"
#############script ends here . Now the output follows
my view is usingh_dev_view
Working directory view: ** NONE **
Set view: usingh_dev_view
Set activity "Tools" in view "usingh_dev_view".
Working directory view: ** NONE **
Set view: usingh_dev_view
val1 =
########### here the value of val1 is not printed ?? why??
tia,
us
- Next message: Barry Margolin: "Re: scp problems"
- Previous message: Alexis Huxley: "Re: A telephone number database system."
- In reply to: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Next in thread: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Reply: Kevin Rodgers: "Re: Executing a command in sub-shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|