So I have this command: ls /opt/logs/rsyncTesting0/ | awk '{print $0}' | cut -d '-' -f6 | cut -d '.' -f1
But I can't seem to save it in a bash variable because every time I try to echo it, I get a blank string. Any ideas on why this is, I'm fairly new to bash.
currentFileHour=ls /opt/logs/rsyncTesting0/ | awk '{print $0}' | cut -d '-' -f6 | cut -d '.' -f1