Categories

Bash script for changing file extension

Bash script for changing extension type on many files inside the directory (for example, if you have many pictures ending in .jpeg and you want to change them to .gif):

#!/bin/bash

echo "source extension?" read source

echo "destination extension?" read target

for i in `ls *$source`; do

file=`ls $i | sed "s/$source/$target/"`

echo "changing source [...]