27 lines
476 B
Bash
Executable File
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
|