I would like to create a script that get's all the folders names in another folder. And execute a script for the names of these folder for lets say every 30 seconds.
So for example we have a folder named "Test" in the root
Under this folder there are 3 other folders named: "One", "Two", "Three"
So like this:
/
├── Test
│ ├── One
│ ├── Two
│ ├── Three
And now i want that all the folders in the folder Test automatically run in a script lets say for example i want to echo the folder names every 30 seconds.
So every 30 seconds on my screen i see:
One
Two
Three
Because currently all the folders are "One", "Two" and "Three".
But when i add another folder, lets say "Four". That my script automatically echo's this folder too. So i will get this every 30 seconds.
One
Two
Three
Four
Could anybody tell me how i can get this done in a bash script?