I have a script that operates on 4 folders.
Because they are completely independent, I'm passing in the folder path to a function and then forking that function. It works, but the output to the console is an unreadable disaster.
The main problem is that I cannot tell which folders have been processed and which ones are still going.
One way I have thought of around this problem is to assign a color to the output based on the folder - Red, Green, Blue and Yellow. The idea is that when there is only red output, I know only folder 1 is still being processed.
All my googling about setting colors in bash talks about using echo or passing in the color for specific functions like grep and ls.
Is there a way to set the color at the start of a function?
set_color()
{
??
}
process_folder()
{
set_color $2
...
}
#in a loop, process my folders using process_folder $folder $color