loops - how to write in bash a function that detect partial names of multiple files in multiple folders? -


i have multiple files e.g. singleta.dat singletb.dat singletc.dat in multiple folders. each file presents common part < singlet > , extension .dat, , variable < b c ...>. go through folders contain these files, , independently variable b c ... convert file name sing.dat example. in bash exist function allows detect these partial variables?

thanks in advance! tommy

you can use find. example:

find mydir -name "singlet?.dat" -execdir mv {} sing.dat \; 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

c# SetCompatibleTextRenderingDefault must be called before the first -