[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [patch] avoid some pitt falls using simple error handling
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2009-04-21 0:19:39
Message-ID: 200904210219.39415.vda.linux () googlemail ! com
[Download RAW message or body]
On Saturday 18 April 2009 15:01, Cristian Ionescu-Idbohrn wrote:
> On Sat, 18 Apr 2009, walter harms wrote:
>
> > you are right error handling is important
> > may be can redefine croak() to
> >
> >
> > error() {
> > echo "$tag: $*" >&2
> > exit 1
> > }
>
> Right. See attached.
>
> > additional points for having logger: (maybe this is to much but i am
> > not sure)
> >
> > if [ -x /usr/bin/logger ]
> > then
> > ECHO=/usr/bin/logger -s -t $(basename $0)
> > else
> > ECHO=echo
> > fi
>
> Maybe. But this is simplier:
>
> ECHO=echo
> ! type logger >/dev/null 2>&1 || ECHO="logger -s -t$tag"
>
> By the way, $(basename $0) is more expensive than ${0##*/}.
I think current example script is good enough.
I can tweak it all day too. s/> file/>file/g, s/ ;/;/g etc...
...this won't make it any better regarding _real_ problem -
what if I have ppp0 interface configured in parallel?
How to make ppp0 and eth0 configs to not stomp on each other?
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic