#!/bin/sh # smv: special move # smv pipeline file1 file2 file3 ... # $1 is the pipeline to apply to the filenames of the files listed CMD="$1" shift for file do mv "$file" "$(printf "$file"|sh -c "$CMD")" done