I'm troubleshooting a script written years ago by another developer. Roughly the script does the following:
Create an empty file
cat > new_file
Process new_file that now has something in it
The script has been working fine with one exception. If the stdin is empty, the script hangs at "cat > new_file". Is there a way to check stdin for value before attempting the cat or a way past the cat if stdin is empty?
Thanks in advance
Create an empty file
cat > new_file
Process new_file that now has something in it
The script has been working fine with one exception. If the stdin is empty, the script hangs at "cat > new_file". Is there a way to check stdin for value before attempting the cat or a way past the cat if stdin is empty?
Thanks in advance