Bash and substring removal
Page content
Deletes shortest match of $substring from back of $string.
${string%”$substring”}
Example
find /var/files -name "*.mp3" | while read string;
do
mv$ $string ${string%"mp3"}wav
done
Deletes shortest match of $substring from back of $string.
${string%”$substring”}
Example
find /var/files -name "*.mp3" | while read string;
do
mv$ $string ${string%"mp3"}wav
done