I would need some help.
I have a bunch of folders, with non-descriptive names.
Inside each folder, there is a "info.txt" file with several lines, but I'm interested in two of them:
artist = Name of the Band
name = Name of the Song
I would like to rename each folder with the structure:
Name of the Band - Name of the Song
I guess some combination of the find, grep and mv commands would do the trick, but I have not enough experience to come up with the correct script or command on my own.
thanks in advance!
=
characters and thatartist
andname
don't occur anywhere in the other lines. With GNUgrep
, you could do:band=$(grep -Pom1 '^\s*artist\s*=\s*\K.*' < "$i")
instead. – Stéphane Chazelas Oct 16 '20 at 08:17^
for precision, and after work a I will see if I can fix the "=" problem. Not an excuse for poor code but an equal sign in a name of a band/song is the rarest thing I've seen :) – schrodingerscatcuriosity Oct 16 '20 at 11:17