Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Mystified by error message

edited September 2009 in FastScripts
I get this:

Error number: 1

... when (successfully) running this:

/usr/sbin/diskutil unmountDisk disk1 > /dev/null

I added the output re-direct to /dev/null to absorb the success report from diskutil. However I get the same error from FS whether the output re-direct is included or not. The Console contains only reports from FS that the disk was successfully unmounted.

Any ideas why FS might be throwing an error would be much appreciated.



  • Hi Peter - it looks like a bug to me in the diskutil tool. It's setting the result "status" to 1 even though it succeeded. Shell tools are supposed to set the status to 0 when they succeed.

    You can quiet down FastScripts by making sure that your script returns with a 0 status. An easy way to do this would just be to add an exit line to the end of your script:

    /usr/sbin/diskutil unmountDisk disk1 > /dev/null
    exit 0

    (Without an explicit exit line, the exit status of the last tool you ran from the script will be the exit status of the script itself).
  • Doh! Of course. I should have thought of that. Thank you Daniel.
Sign In or Register to comment.