In a Linux shell, I would like to treat a folder like a bag of files. There are some processes that put files into this bag. There is exactly one process that is in either one of the two following states:
- Process a document, then delete it
- Wait for an arbitrary document to exist in the folder, then process it
It does not matter in which order the documents are processed or what their name is.
What would the unique process taking files from the folder look likein bash? Processing means calling another program with the filename as argument.
Note that this unique process will not terminate until I do so manually.