Powered by WHUK®

Announcement

Collapse
No announcement yet.

How to set date using Bash Script?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to set date using Bash Script?

    Iím trying to write the bash script to get date after every week. Could it be possible?
    Here is my command:
    Code:
    exiftool -exififd:dateTimeOriginal="2016:06:15 00" blog.jpg
    So instead of 2016:06:15, I want to pass a date value then run a while loop to batch process files.

  • #2
    You can use bash expression $(command) for process substitution as follows in your command and format the date bar as per your requirement.

    exiftool -exififd:dateTimeOriginal="$(date + "%y:%m:%d") 00" blog.jpg

    Comment


    • #3
      Thanks Kelvin. I edit my script appropriately.

      Comment


      • #4
        Hi Kelvin,

        Can you please help me with the following?
        https://github.com/Guilty-King/Scrip...ter/exif_batch


        I need to ep variable to display output as 01 instead of 1

        Comment


        • #5
          Originally posted by Sven View Post
          Hi Kelvin,

          Can you please help me with the following?
          https://github.com/Guilty-King/Scrip...ter/exif_batch


          I need to ep variable to display output as 01 instead of 1
          Try the following command like
          'temp=$(printf %01d $ep)'

          Comment


          • #6
            Finally It's worked. Thanks Kelvin for your help. Much appreciated.

            Comment

            Working...
            X