Files
shellfiles/bin/wsl/rename_front.sh
2026-01-19 21:36:25 -05:00

27 lines
476 B
Bash
Executable File

#!/bin/bash
SAVEIFS=$IFS
export IFS=$'\n';
CDIR=$(pwd)
read -p "starting name to add to front: " startfront
echo "Renaming front with ${startfront} ";\
if (pwd | grep -c '\/home\/mobaxterm'); then
echo "Correct Directory"
echo " "
else
echo "non-recursive: proceeding in non-mobaxterm directory"
echo " "
# exit 0
fi
for i in `ls`; do
newfile=`echo "${startfront}${i}"`
echo "moving ${i} to ${newfile}"
mv ${i} ${newfile}
done
IFS=$SAVEIFS