script troubleshooting

DanSloan
New Contributor

Hi All,
I am struggling adding scripts. I have had success in the past, but am striking out lately.
I am getting this message:
Script result: /bin/sh: /private/tmp/LawKeck_BW_85425_PS-20131021.sh: No such file or directory
My normal troubleshooting steps are:
check to make sure file is executable Make sure line ends are unix
check for incorrect characters
put a complete path in script

what else can I do?
I have removed everything from script but this:

/usr/sbin/lpadmin -p "LawKeck_BW_85425_PS" -v "lpd://printvm04/LawKeck-BW-85425-PS" -D "LawKeck-BW-85425-PS" -L "Law Keck" -P "/Library/Printers/PPDs/Contents/Resources/HP LaserJet 600 M601 M602 M603 mod.gz" -E -o printer-is-shared=false -o HPOption_Duplexer=True -o HPOption_Tray3=HP500SheetInputTray -o cupsSNMPSupplies=false -o cupsIPPSupplies=True -o Duplex=DuplexTumble
3 REPLIES 3

mm2270
Legendary Contributor III

Do you have a shebang at the top of the script? Meaning #!/bin/bash or #!/bin/sh? Its gotta have that or it won't work.
Second, what did you create the script in? While you can use something like TextEdit, you need to take some precautions. You'd be better off getting a free copy of TextWrangler from the Mac App Store and using that, IMO. It ensures a script won't have any hidden formatting from a text editor that could foul up the script.

DanSloan
New Contributor

Thanks MM, I do have the shebang at the top. Using TextWrangler.

mm2270
Legendary Contributor III

OK, then did you check to see if the script is actually on the share where its trying to pull it from? Sometimes that "No such file or directory" actually means, no such file or directory.