rm -- "$0" No longer removes file

Issues related to applications and software problems and general support
Post Reply
Posts: 1
Joined: 2020/10/12 12:55:01

rm -- "$0" No longer removes file

Post by BrianD » 2020/10/12 13:01:50

rm -- "$0" No longer removes the file, but simply leaves a "0" in its place. Is this a bug or am I missing something?

User avatar
Forum Moderator
Posts: 29681
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: rm -- "$0" No longer removes file

Post by TrevorH » 2020/10/12 14:31:22

What were you expecting it to do? $0 is set to the name of the program you invoked so, for example, if you run echo $0 in a bash shell you get the answer 'bash' so if you are intending to rm bash then your command is correct. If not then it's not.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 8 - General Support”