1 2 3 4 5 6 7 8
#!/bin/sh for x in "$@" ; do dir="$(dirname $x)" filename="$(basename $x)" ext="${filename##*.}" mv "$DESTDIR"/"$x" "$DESTDIR"/"$dir"/module."$ext" done