Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想下载一个名称为前一天的文件。今天的日期示例:20131021
文件名: 20131020-blah.gz
20131020-blah.gz
到目前为止,我已经想出了这个..但它不起作用:
wget ftp://blah:blah@ftp.haha.com/'$(date +%Y%m%d -d)-blah.gz' /myFolder/Documents/
wget ftp://blah:blah@ftp.haha.com/"$(date +%Y%m%d -d yesterday)-blah.gz" /myFolder/Documents/
The key part is:
$ date +%Y%m%d -d yesterday 20131020
Also note the use of double quotes instead of single quotes.