I am trying to scp the latest file which ends with "_abc.log". Can some help me figure out how can do that?
/bin/ls -t *_abc.log | head -1 | read latest_file
echo LATEST FILE IS: $latest_file
Can you tell me how can i put this in expect script?
been a long time since i coded in Tcl...
but you can run commands with "exec" and I believe you can read from pipes
using "open"
I would suspect "open" is your best bet...
hopefully, spotting you those 2 Tcl commands should get you closer...