OT: sed + exit status

Mike Jeays mike.jeays at rogers.com
Sun Feb 15 05:58:02 PST 2009


On February 15, 2009 01:26:27 am Dimitar Vasilev wrote:
> >        .  Is sed "successful" is there are no instances of FOO?  Or
> > only if there is at least one instance of FOO and it is successfully
> > replaced by bar?
> >
> >        Respectfully,
> >
> >
> >                                        Robert Huff
> >
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "
> > freebsd-questions-unsubscribe at freebsd.org"
>
> Hi Robert,
> try to use truss or strace to see the exit codes in both cases.
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"


 Both cases return an exit code of '0'. You can check more easily by putting 
the command 'echo $?' directly after the sed command.


More information about the freebsd-questions mailing list