From: kazaam Date: 2007-08-25T03:25:03+09:00 Subject: Re: How to check for an error if executing a shell command e.g. with system('commandhere')? lol thanks this really works :D On Sat, 25 Aug 2007 03:11:20 +0900 Stefano Crocco wrote: > Alle venerd� 24 agosto 2007, kazaam ha scritto: > > Hi, > > I'm writing a little script to install some drivers but I wanna react in > > this script if any step fails. So e.g. I'm doing this: system('dpkg -i > > xorg-driver-fglrx fglrx-kernel-source') > > How can I check if this was succesful or if there was any error? > > I think you should check the return value of system. It will return true if > the command was run successfully and false otherwise. > > Stefano > -- kazaam