Re: [Suggestion] Add warning/error when using the tilde expansion in a f
From:
Chet Ramey
Subject:
Re: [Suggestion] Add warning/error when using the tilde expansion in a folder where the tile-named file/folder exists
Date:
Thu, 13 Feb 2025 17:44:46 -0500
User-agent:
Mozilla Thunderbird
On 2/12/25 10:50 AM, Andrés Rodríguez Reina wrote:
Bash Version: 5.0
Patch Level: 17
Release Status: release
Description:
Due to a mistake in coding a script, a folder named '~' was generated. An
unexperienced bash user issued the command "rm -rf ~" by mistake, intending to
delete the '~' folder, but this resulted in deleting 150GB+ of data at their home
directory.
In my opinion, it would be useful to have a warning be issued when in
interactive mode, when at the current working directory a file/folder named '~'
exists, and a command with a parameter starting with ~ is used (which will
produce tilde expansion).
Thanks for the suggestion. I'm not inclined to implement it.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/