Get filename without extension

set -e
# Description: Filename informations.
# Create test data.
TMP_DIR="./tmp some directory"
mkdir -p "${TMP_DIR}"
echo "some text" > "${TMP_FILE}"
# Get different information of file.
FULL_PATH=$(realpath "${TMP_FILE}")
FILENAME=$(basename "${FULL_PATH}")
DIR_OF_FILE=$(dirname "${FULL_PATH}")
echo "Full path = ${FULL_PATH}"
echo "Filename  = ${FILENAME}"
echo "Directory = ${DIR_OF_FILE}"
echo "Don't process file extension. Otherwise, it will not be cross platform."
echo "File type = $(file "${FULL_PATH}")"
# Clean up.
rm -rf "${TMP_DIR}"

To clean up:

for i in *.JPG; 
do mv $i `basename $i JPG`jpg; 
# or
for i in *.JPG; 
do mv $i ${i%%.JPG}.jpg;