Re: Question regarding bash scripting

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

 



On 6/22/19 10:31 AM,   sixpack13 wrote:
sudo rm -rf /boot/loader/entries/*MY*;
sudo rm -rf /boot/*MY* /lib/modules/*MY*;
sudo grub2-mkconfig -o /boot/grub2/grub.cfg;

Side point, you don't need semicolons at the end. Those are only to separate commands on the same line.

and now my problem:
the first sudo rm -rfv command does NOTHING, means the loader entry is still there and I need to rm it by hand.
whereas the second rm command does what I espect.

You are getting tricked by a common misunderstanding. The expansion of wildcards is done by the shell before running the command and rm only uses exactly what it is given. As a user, you don't have permission to look in the entries directory. That means that the wildcards are passed directly to rm as-is because the shell can't find any matches. rm doesn't find a file with a name called literally "*MY*", so it doesn't delete anything.
_______________________________________________
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



[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