I have a script that has the the following variables
## Get User Name.
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
PATH1='/Users/$loggedInUser/path/to/folder/'
Then it uses expect to pass the path to a SCP command. When passing the path it leaves the text as "$loggedInUser" and does not put the username in
/usr/bin/expect<<EOD
# Set Timeout of Expect
set timeout -1
spawn /usr/bin/scp -r $PATH1 $USERNAME@$HOST:/Volumes/Storage/sftp/$loggedInUser/
expect "Password:"
send "$PASSWD
"
EOD
Any ideas how to get the path to contain the username?