Error Message [shell script]

Hi All,

Has anybody had this error message when running a script?

“The command exited with a non-zero status.”

It happens after this shell script within my applescript…

set loadbalance to "DEST=/Volumes/Nexus1_HotFolders/Hotfolders/Hotfolders/Collect_Output&& cp  -pr " & g_text19 & " $DEST/" & artworkref & ""
do shell script loadbalance

I’m stuck because i don’t understand the message, so i don’t know how to fix the script…

Thanks

Kyle.

Does g_text19 or artworkref contain any spaces?

You might try this instead:

do shell script "/bin/cp  -pr " & quoted form of g_text19 & space & quoted form of ("/Volumes/Nexus1_HotFolders/Hotfolders/Hotfolders/Collect_Output" & artworkref)

Thanks for the reply Bruce, but got round it in the end…

i deleted the ‘p’ before the -r on the shellscript and it runs fine again!!?!?!?

set loadbalance to "DEST=/Volumes/Nexus1_HotFolders/Hotfolders/Hotfolders/Collect_Output&& cp  -r " & g_text19 & " $DEST/" & artworkref & ""
do shell script loadbalance

Thanks for the reply.

Interesting, I had thought -p fails greacefully still returning exit code 0, apparently thats not the case though.
.
.
.
Actually looking at the man page the wording is

So perhaps the error is that one of the other options are not presereved and thus your exiting on an error. If you do the original command form the terminal itself does it error?

What filesystem does the destination use?

Regardless of the source of the error, I suggest using ditto instead. More robust, and cp doesn’t preserve resource forks under Panther (where ditto’s --rsrc flag will).

$ man ditto