Re: unix shell script ignores 'exit' when in function that is piped to tee

onealwc_at_agedwards.com
Date: 01/11/05


Date: 11 Jan 2005 08:32:57 -0800

Dear Lew Pitcher,

Thank you for taking the time to reply and share your knowledge. I
must agree with you in that I misunderstood how functions, pipes and
sub-shells work.

I thought calling a function within a script did NOT create sub-shells.

This new enlightenment goes to show I asked the wrong question. The
question I should have asked is; In a sh script, can a child kill a
parent, and if so, how is this done?

I ask this because your example code fix does not help me with my real
world app.

The real world app must log for auditors what the admin see and how the
admin responds, each with date/time stamps. Thoughtout most of the
script this is done by calls to aa function I have written called LOG
which echos its arguments to the screen and to an audit file preceeded
by a date/time stamp. In the script I have two section where I found
using LOG either impossible -or- impractical. For these sections, I
turned them into functions and piped them to tee. If a child cannot
kill it's parent, then I will re-org the script such that there is
only one function that is tee'ed and that it is the last call within
the script.

Look forward to reading your reply.



Relevant Pages

  • Re: need to modify local group membership via VBscript
    ... Admin run the script on all NT computers. ... script can add domain groups to the local Administrators group. ... how to add a domain group to local administrators account: ...
    (microsoft.public.windows.server.scripting)
  • Re: need to modify local group membership via VBscript
    ... domain admin credentials in the script, then run the script through the ... script would have to use alternate credentials or a third part RunAs tool. ... ' Bind to local Administrators group on remote computer. ...
    (microsoft.public.windows.server.scripting)
  • Re: need to modify local group membership via VBscript
    ... Admin run the script on all NT computers. ... script can add domain groups to the local Administrators group. ... how to add a domain group to local administrators account: ...
    (microsoft.public.windows.server.scripting)
  • Re: Redirect computers to a specific OU by IP Address
    ... Getting theIPaddress of the workstation is easy if you are running the ... script from the workstation. ... COMPLETELY lock them down until an admin put them into the rightOU. ... used for approx 180-240 days (as there is over 1000 computer accounts ...
    (microsoft.public.windows.server.active_directory)
  • Re: Domain Admin Account deleted by local Admin
    ... ou for every wise guy and enforce a group policy that contains also his ... domain account in order for him to keep his admin rights on that computer. ... >> domain admin from local administrators group. ... > Create a GPO based computer startup script that adds the "domain ...
    (microsoft.public.windows.server.active_directory)