I'm not sure if this question has been asked or answered. If it has, I apologize. I wasn't too sure what to look for, but I'm writing a bash script to take in a path from the user, my script works with absolute and relative paths. But I was wondering if there was a way to interpret the shorthand notation to these paths. For example ~/ for home or . for current or ../ for a directory up. I was having a bit of trouble figuring this out. Here is my current bash script for reference.
#!/bin/bash
echo "What is the path you'd like me to search?"
read PASSED
while [ ! -d $PASSED ]; do
echo "$PASSED is not a valid directory"
echo "Please provide a valid Path"
read PASSED
done
ls -l $PASSED | awk -v user=`whoami` '{ if($3 == user){print $0}}'