I have a launch daemon that runs an AppleScript that converts PostScript files to PDF and tries to print them. The script includes lines like these:
set ptrCount to (do shell script "lpstat -p | grep -c 'enabled'")
set printerNames to (do shell script "lpstat -l -p | grep -i Description: |awk -F'Description: ' '{print $2}' ")
set queueNames to (do shell script "lpstat -a | awk -F' accepting' '{print $1}'")
The script works perfectly when the system language is English, but fails with anything else, because those strings aren’t the same in non-English systems.
Is there any way to force a shell script to give English-language responses? Or will I have to build lists of possible translations of “enabled”, “Description”, “accepting”, etc. and test for any of them? That seems impractical, but I’m not sure there’s an alternative. Any suggestions will be very welcome.