简体   繁体   中英

How to insert yesterday's date in the email's subject using xml?


<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <From>xxx@yyy.com</From> <!--Must be valid email-->

    <To>xxx@yyy.com</To> <!--Must be valid email-->

    <CC>xxx@yyy.com</CC> <!--Must be valid email-->

    <Subject>The report is for  </Subject> <!--Must be yesterday's date-->

<Message>D:\Msg.txt</Message> <!--Set the email content-->

</Config>

This is code that i am using to fill in the email details & i would like to get yesterday's date in the subject.

Use to edit the file in place :

xmlstarlet ed -L -u '//Subject' \
    -v "The report is for $(date -d yesterday '+%m %d %Y')" file.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM