Re: Executing a command in sub-shell

From: udayan (udayan_singh_at_lko.tcs.co.in)
Date: 02/11/04


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



Relevant Pages

  • Re: cryptofinder file
    ... > net start cryptsvc ... > Type EXIT to close the command prompt, ... install the patch again. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: locked out of windows XP ? ntoskrnl.exe
    ... When you are in the recovery console, ... Login to the Administrator account by typing the password for ... Type exit, and press ENTER at the command prompt. ...
    (microsoft.public.windowsxp.general)
  • XP patch 823980 install soution
    ... cryptographic service is running on this computer", ... At the command prompt, type the following commands, ... Type exit to close the command prompt, ... commands, pressing the ...
    (microsoft.public.windowsxp.security_admin)
  • Re: is someone monitoring my PC?
    ... Now it just flashes. ... Once you're in the command prompt window, run the netstat command from the ... Type EXIT to close the command prompt. ...
    (comp.security.firewalls)
  • Re: How to show the real directory instead of "~" (=HomeDir) in prompt pattern ?
    ... On Friday 02 June 2006 15:49, Stephen Neal stood up and spoke the ... following words to the masses in /comp.os.linux.misc...:/ ... I personallly use *\$PWD* in my command prompt. ... It displays the complete path to the working directory, ...
    (comp.os.linux.misc)

Loading