2
current date 2018 -10 -31

In my RemoteFolder directory, I had the below list of files. I am trying to pull yesterday's file (i.e 2018-10-30)

Test_20181031000000_ual
TestProfile_201830722000000_full 
Test2_2018103000000_ual2 
Test2_2018103000000_usage
Test2_2018102900000_ual2
TesI2_2018102900000_usage

i wanted to pull files having yesterday's date in their filename. i used the below sftp logic, I am able to pull with current date . please suggest how to proceed. Thanks in advance

sftp ${UserName}@${HostName} .. get *$(date +%Y%m%d)* 
Jan Sršeň
  • 1,045
  • 3
  • 23
  • 46
  • StackOverflow is designed as a database of questions **and answers**. If you search for `[unix] yesterday's date`, you'll find 60+ Q/As. This on looks to answer all of your Qs. https://stackoverflow.com/questions/3517982/in-a-unix-shell-how-to-get-yesterdays-date-into-a-variable?s=1|95.4049 . Please read the [help] and [mcve] before posting more Qs here. Good luck. – shellter Nov 01 '18 at 02:13

0 Answers0