Exactly what is `</ dev / null` when reading is done using null?
'> /dev/null'- very common syntax and something that is not a new concept; but I came to this scenario and could not understand the logic '< /dev/null', especially with FFMpeg.
I wrote dozens of scripts that handle FFMpeg, and I found that in order for the script itself to successfully execute and run FFMpeg, adding ' < /dev/nullffmpeg' to the end of the command line. For example:
ffmpeg -i $INPUT -c:v copy -c:a copy output.mp4 < /dev/null
But if I had not added that sytnax at the end of the command, the script could not "click" the execution in FFMpeg. I understood the whole concept when it comes to “writing” as >for all null, stdout, stdin values, but ... readby null? head scratches
So what < /dev/nullexactly is?
For many systems, you can refer to the manual page for special devices. For example, Linux null (4) docs:
Reading from / dev / null always returns the end of the file
FreeBSD null (4) says differently:
The null device receives and reads data as a regular (and desired) file, but discards it. The length of the null device is always zero.
which is less clear. Solaris null (7) says
Reading from a zero special file always returns 0 bytes.
/dev/null script, , , script - . , , , .