`Nested (`Nested Subshells`) Subshells`

`Nested (`Nested Subshells`) Subshells`

Post by Todd C. Gleaso » Sat, 05 Jun 1993 23:11:01

I'm trying to nest commands in a script file so that I can do an if
checking in one command.  Here's the command thus far:

if ((`/bin/hostname | fgrep -c mirror` == 1) && `(((finger | grep
"whoami") | grep "tty | cut -c9-11") | fgrep -c vortex)` != 0) then

As can be seen, even with the parentheses, the shell doesn't like it.
It won't ever run the inside when it is supposed to.  The problem seems
to be that when it fingers, it greps for the string "whoami", not for
the string returned if one ran "whoami".  But since the finger is itself
enclosed in backquotes, how does one quote the whoami such that it

Please E-mail or CC all responses to facilitate things, or I might miss them.

---===<<<(((###     -=Todd Gleason=-     -=Cool-Man=-     ###)))>>>===---
From computer arguments to the love of women, as far back as the dawn of
Cal-Clue-Less to the future of balloons, with music arcane and actions
forbade, for the Command Chair and the glory of Ramen, this is ME, and
these are the times upon which the greatest of sagas shall be written. . . .


1. tcsh - to subshell or not to subshell

I have a requirement to able to set environment variables in s script
and provide the value remain in the invoking shell.

For example using ksh I can create a script a.sh as:
      export CVS
Then I can execute the script in the same shell  (using the ".
<sp><file> )as follows:
     .  ./a.sh

This results in the envir var CVS being set in the invoking shell.

Now, I have users wanting to use tcsh; can this be done in tcsh??
ie invoke a script that runs in the invoking shell so that environment
changes are retained ??

Thanks in advance for you help.


2. Help me booting from RAID1

3. Question: How are subshells forked

4. ed and external variables

5. subshell level?

6. Unresolved symbols in module

7. Help : subshell.c : couldn't open master side of pty

8. Linux / Windows 95 modems

9. invoking a script (not in a subshell)

10. gnu midnight commander bash subshell not working (aix 4.2.1)

11. subshell blown away! HELP!

12. bash: Can a "function" be run without a subshell?

13. Subshell vs. New Shell