Quote:
Originally Posted by
xgringo
Could you also explain to me what this is doing?
files="$mpf `echo $mpf | sed 's/f$/e/'` `echo $mpf | sed 's/f$/d/'`"
Sure, this creates a string containing the three files we're going to be moving in one set (blah.mpf, blah.mpd and blah.mpe).
You say that the .mpf generally arrives last so I'm looking for those to keep things efficient. This means that we start with all .mpf files and for each one, and generate a 3 element, space seperated list from it.
This is done by using sed to replace the last letter of the filename (ie 'f') with e in the second field and d in the third. The sed segments sare saying:
"take the .mpf filename, and look for a part of the name that has an 'f' followed by the end of line, then replace it with an e (or a d)".