I am trying to write my first real script, and I have a problem. I simply want to record 1 second of audio to a file, and do so on an automated basis. My script is:
The problem is that the process "sox" still runs after my script
executes and the output file is corrupt. Any help on this would be
appreciated.
Are you sure SIGINT is handled correctly by 'rec' ? Can you kill it by issuing the command at the command line? Look if it is a matter of the 'rec' or may be a wrong PID in $!
and may be directing stderr as well to /dev/null. The exact syntax depends on the used shell. You never talked about the system and tools you are using.
I would like to see if there is a command I can run which gives me the line number for each of the above line. Another option would be to compare the date/time of above two lines but not sure how can that be done easily.
I am a writing another script which would read this messages file and will send out an alert if CRITICAL_ISSUE line is before "ASC" line.