I'm trying to match a filename to a string, which is basically a timestamp, during an SFTP connection.
How do I match part of the filename? I can't seem to declare a variable within an SFTP connection. And neither can I call a variable created in Bash beforehand.
Edit: things I've tried
yr=$(date + "%Y") sftp -i key.pem un@server sftp> echo $yr Invalid command. sftp> $yr Invalid command.
sftp -i key.pem un@server sftp> test=$(date +"%Y") Invalid command.
Tried those 2