Catching errors in a shell scripts
Arsya Pandji
arsya.linux at gmail.com
Tue Apr 10 16:34:32 UTC 2007
Just a bit information about this line
OUTPUT=`command 2>&1`
It should redirect the stderr (standard error) to stdout (standard output).
Nice way.
regards,
Arsya
On 4/8/07, Nils Kassube <kassube at gmx.net> wrote:
>
> On Sunday 08 April 2007 02:58, Simon Skogh wrote:
> > I'm sure the subject line is a tad confusing, but I'm having problems
> > coming up with a better description.
> >
> > To cut to the chase, what I'm trying to achieve is executing a command
> >
> > >from within a shell script and trap it in a variable. This works just
> >
> > fine using something like
> > OUTPUT=`command`
> > but it doesn't seem to grab any errors.
>
> May I suggest, you replace your statement with
>
> OUTPUT=`command 2>&1`
>
>
> Nils
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070410/3701d47f/attachment.html>
More information about the ubuntu-users
mailing list