#prompt the user to enter pathname and store it to a variable
pathname=$(zenity --entry --text "Please enter Bash shell script FULL pathname: ")
ls $pathname > /dev/null 2> /dev/null #check if the pathname exists
#for $pathname in $HOME/*
while [ $? -ne 0 ]
do
zenity --entry --text "File pathname\"$pathname\"cannot be used.\n\nPlease check if you can create file in that directory path.\n\nPlease re-enter a valid FULL script pathname"
#if wrong, diplay the waring information
done