Jhamil Mercado wrote:

[...]

> como verifico dentro un script que un comando se haya
> realizado con exito o no?

Inmediatamente despues de ejecutado un comando, consulta la variable
$?. Si esta es igual a cero, el comando anterior termino con exito. Algo
asi:

,----
| <comando>
| 
| if [ $? = 0 ]; then
|   echo 'Uf! estuvo cerca!'
| else
|   echo 'Damn!'
`----

Eso vale para la mayoria de (todos?) los comandos del sistema. Si vas a
usar un programa hecho por ti entre medio, asegurate que haga un
"exit(0)" cuando encuentre todo bien.

-- 
Cristian Gutierrez                      http://www.dcc.uchile.cl/~crgutier
[EMAIL PROTECTED]                        Jabber:[EMAIL PROTECTED]

A computer scientist is someone who, when told to 'Go to Hell', sees the 
'go to', rather than the destination, as harmful.

Responder a