Re: unix shell script ignores 'exit' when in function that is piped to tee
onealwc_at_agedwards.com
Date: 01/11/05
- Next message: Rakesh Sharma: "Re: inserting CR/NL (with sed?) in some ASCII files"
- Previous message: V. L. Simpson: "Re: Check for a group"
- In reply to: Lew Pitcher: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Next in thread: Nunya Bizness: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Reply: Nunya Bizness: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Rakesh Sharma: "Re: inserting CR/NL (with sed?) in some ASCII files"
- Previous message: V. L. Simpson: "Re: Check for a group"
- In reply to: Lew Pitcher: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Next in thread: Nunya Bizness: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Reply: Nunya Bizness: "Re: unix shell script ignores 'exit' when in function that is piped to tee"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|