I am trying to write a script (either shell or python) that will run a program on all files in a specific directory all at once (the program will constantly run so will not need to wait for one file to finish before starting the next one). I plan to use a systemd service to auto stop/start it in the future when a new conf file is added so it can spin up the new conf along with the others in the dir.
I am having trouble with this as I need to specify an option in the shell command so the program knows to look for a conf file to use. For example, I have a load of .conf files in directory /data/ and I want to run the command on each of these files at the same time, to do this I have to run the shell command 'myprogram --config 'filename''
When I do this manually it works fine however when I add this into a shell script the '--config' is causing it to fail. I am also struggling to script this so it runs on each .conf file in the data dir as when running the command manually I can only run it on one file at a time even if I run 'myprogram --config /data/*'
Any ideas how I might be able to achieve this? Thanks!