#!/bin/bash # # Syntax: mvu [-h] file [...] # # Purpose: Converts filenames from lower case to upper case. # The -h flag shows the help info for this command. # Created: Oct 1, 1993 by Bart De Schutter # Last revised: Jul 26, 2007 by Bart De Schutter # # See http://www.deschutter.info/util/scripts.html for the latest version of # this script. # Status: public # Category: files if [ $# -ge 1 -a "$1" = "-h" ]; then sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi if [ $# -eq 0 ]; then echo >&2 echo >&2 "ERROR: ${0##*/} requires at least 1 input argument." echo >&2 sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi for fname in "$@" do if [ -e "$fname" ] then uname=$(echo "$fname" | tr a-z A-Z) \mv "$fname" "$uname" else echo >&2 "WARNING: file or directory $fname not found." fi done