2022-03-18 13:12:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-03-18 13:34:44 +01:00
|
|
|
# Function to detect -h flag and show help for this script
|
2022-03-18 13:26:33 +01:00
|
|
|
show_help() {
|
2022-03-18 13:34:44 +01:00
|
|
|
local OPTIND
|
2022-03-18 13:26:33 +01:00
|
|
|
while getopts ":h" opt ; do
|
2022-03-18 13:34:44 +01:00
|
|
|
case "$opt" in
|
|
|
|
|
h )
|
|
|
|
|
echo "This script modifies file names"
|
|
|
|
|
echo "-l lowerize file names"
|
|
|
|
|
echo "-u uppercase file names"
|
|
|
|
|
echo "-r recurse into directory"
|
|
|
|
|
echo "[-r] <sed pattern> specify sed pattern that will be executed on file names"
|
|
|
|
|
echo "-h show this help information"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2022-03-18 13:26:33 +01:00
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
show_help "$@"
|