I am working on a simple shell script to change a file one.PDF
to one.pdf
. I have this file stored in a folder called Task1.
My script is in the same directory as Task1. Called Shell1.sh
When I run it Task1 becomes Task1.pdf but the file inside one.PDF doesn't change. I need it the other way around but nothing I try seems to work I keep alternating between a syntax error, mv not being able to move because a resource is busy or just renaming the directory.
Can anyone tell me what I'm doing wrong?
#!/bin/bash
#shebang for bourne shell execution
echo "Hello this is task 1"
#Initial prompt used for testing to see if script ran
#/rename .* .pdf *.pdf // doesnt work
#loop to iterate through each file in current directory and rename
for file in Task1;
do
mv "$file" "${file%.PDF}.pdf"
done