I'm currently using the following line to find a number of scripts and execute them. The scripts are named as : my_script_0.sh, my_script_1.sh, etc.
find $MY_HOME/SHELL/my_script_[0-9].sh -type f -exec csh -c '"$1" >& "$logfile" &' {} \;
This works fine except that now I would like to create a unique $logfile
for each of the executed scripts.
I realize that using awk I could do something like this to grab the number of the file and then potentially use that in the logfile name.
find $MY_HOME/SHELL/my_script_[0-9].sh -type f | awk -F"\\.|_" '{print $4}'
The issue is that I don't believe I can use awk with the original statement since I need the positional parameter to be the full path/filename.
Ideally I would like to simply use another positional parameter with the find -exec command. Does it exist?