Severe newb here. I have a shell script that simply calls a perl script to create a file. It works if I double-click the SH file, but fails if I call the file in a terminal. here is the entire SH file:
#! /bin/bash
# Run Will's JSON Script
perl /Users/j.douet/Documents/JSON/pbmJson.pl -i /Jaspersoft/tmp/output/hospicemed/hhcsys/hhcsys_hospicemed_201711251121140465.txt -m newPatient -n 1234 > /Jaspersoft/tmp/output/hospicemed/hhcsys/hhcsys_hospicemed_201711251121140465.json;
It really is that simple. No arguments yet as I am testing. When I double-click, my output file is created, but when I execute
sh runhmJSON.sh
I get errors within the perl script, all similar to:
/Users/j.douet/Documents/JSON/pbmJson.pl: line 3: use: command not found
Thoughts?
Best Answer
That error indicates your
pbmJson.pl
is being run by a shell, and not byperl
:As written, I see no error in what you've posted: