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:
rec sample.au & sleep 1s kill -INT $!
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.