In my bash script, i want to update a string according to new written filenames with .dat format. Here is what i try to basically:
- For example, i use
blabla_3200.datfile in my bash script, then run a case with this script. - After this case is done, a new
blabla_3300.datis written in same directory - For the next run, i want to use this last
blabla_3300.datin same bash script.
Therefore, I have to search maximum integer in filenames with .dat format, and with sed command i will update my bash script like
sed -i 's/3200/max/g' mybash.sh
then run a new case.
Any help will be appreciated Have a good day!