#!/bin/sh [ $# -eq 0 ] && { echo "usage: sp2us file ..." >&2; exit 1; } for f in "$@"; do mv -f "$f" "$(echo "$f" | tr ' ' '_')" done .