Re: OT: Working on script to add Memtest86+ version 6.20 to Fedora boot menu

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

 



On Wed, Jun 7, 2023 at 12:53 PM Michael D. Setzer II via users
<users@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> rm index.html -f
> wget https://memtest.org/
> f=$(grep -m1 binaries.zip <index.html | cut -f2 -d\")
> rm index.html -f
[...]
> Thanks for any suggestions..

replace above with:

f=$(wget -O - https://memtest.org/ 2>/dev/null | grep -m1 binaries.zip
| sed -e 's/.*<a href="//' -e 's/".*//')
if [ -z "$f" ]
then
  echo "Unable to get pathname for binaries.zip" >&2
  exit 1
fi

this way you avoid creating the temporary file and therefore don't
have to worry about deleting.  Also checks to make sure you actually
got a pathname.  Should also be somewhat more tolerant of changes to
the underlying html.
_______________________________________________
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