The command exited with a non-zero status

Hi

This line was working until 2 days ago:


tell me to set theResult to (do shell script "fgrep " & search's quoted form & space & MeterReadingsCSV) -- extract string

Now I am getting this error:

tell current application
do shell script “fgrep ‘2020 Sep 24’ /Volumes/config/www/MeterReadings.csv”
→ error “The command exited with a non-zero status.” number 1

The network share is accessible and the file is present.

Any ideas?

Thanks

Model: iMac
AppleScript: 2.7
Browser: Version 1.14.81 Chromium: 85.0.4183.102 (Official Build) (64-bit)
Operating System: macOS 10.14

An Apple technical note contains the following:

https://developer.apple.com/library/archive/technotes/tn2065/_index.html#//apple_ref/doc/uid/DTS10003093-CH1-TNTAG2-HOW_DOES_DO_SHELL_SCRIPT_REPORT_ERRORS_

The fgrep man page notes the following exit status values:

0 One or more lines were selected.
1 No lines were selected.

1 An error occurred.

So, my suggestion is that the OP look at the MeterReadings.csv file to insure it contains the search text. I did test the code contained in the OP’s post and it worked fine for me.