Web Hosting Talk







View Full Version : [bash scripting] last executed command return value?


=-D
06-08-2005, 12:32 PM
I have a bash script running an rysnc command, like so:

rysnc -avz -e ssh ./ user@server

I would like to find out if the command was successful or not. I cant remember which variable it was stored in, or how to find it out.

Lil help much appreciated!

hiryuu
06-08-2005, 05:26 PM
It's pretty difficult to find in the man page, but it's $?

VolkNet
06-09-2005, 02:00 AM
This sounds like a very useful thing. Thanks! :)