I have the following problem using UNIX Commands. I wish to go through a large number of files and convert them using a command that converts them. My idea is to work like this: command *.fileending > *.newfileending
The problem is that I wish to keep the file-names and only replace the file-ending. Thus filename.fileending should become filename.newfileending. How do I achieve this?
Use a for loop:
In a single line:
for file in *.krn; do hum2mid "$file" -o "${file%.krn}.mid"; doneTo apply the command to files and subdirectories recursively, use the
find|xargspattern:Note that this will overwrite already converted files, if a file from another directory has the same name.