28 lines
721 B
Bash
Executable File
28 lines
721 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Check if scheme is provided
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: rename_filtered <scheme> [folder]"
|
|
echo
|
|
echo "Example:"
|
|
echo " Files in folder:"
|
|
echo " myfile_E123.txt"
|
|
echo " myfile_E456.txt"
|
|
echo " myfile_E789.txt"
|
|
echo " myfile_E2468.txt"
|
|
echo
|
|
echo " Run:"
|
|
echo " rename_filtered \"????????E!!!\" ./"
|
|
echo
|
|
echo " Result:"
|
|
echo " myfile_E123.txt → 123.txt"
|
|
echo " myfile_E456.txt → 456.txt"
|
|
echo " myfile_E789.txt → 789.txt"
|
|
echo " myfile_E2468.txt → myfile_2468.txt"
|
|
|
|
exit 1
|
|
fi
|
|
|
|
# Call the Python script with scheme and optional folder argument
|
|
python3 /home/honney/.bin/rename_filtered.py "$@"
|