Re: script to loop through dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 27, 2025 at 8:32 AM olivares33561 via users <users@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
Dear Fedora users,

I am struggling to create a script that generates a series of dates with special "+%Y.%m.%d" like the following

2025.06.01
2025.06.01
2025.06.01
2025.06.01
2025.06.02
..
..
..
2025.06.03
..
..
..
.
Through
2025.06.30

Print four dates of June 1, then June 2, all the way through to June 30

I found several examples but can't succeed to get what I want
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

From man date: "The date string format is more complex than is easily documented here but is fully described in the info documentation."

% cat sequential_dates.sh
start=2025-06-01
for i in `seq 0 5`;
do
  for j in `seq 0 4` l
  do
    date -d "$start $i days" +%Y.%m.%d;
  done
done;

--
George N. White III

-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux