On Sun 05 Mar 2023 at 16:30:10 (-0500), Greg Wooledge wrote: > On Sun, Mar 05, 2023 at 02:37:48PM -0600, David Wright wrote: > > There are many lists of dangerous aliases on the web, but I haven't > > found a list of such aliases that can't be transcribed into functions. > > Here's one document: > > https://www.chiark.greenend.org.uk/~sgtatham/aliases.html
An enjoyable article, thanks. A nice illustration of Cambridge computer scientists' ingenuity. But it clearly has no connection with my criticism of man dash. So, you can combine a carefully crafted pairing of alias and function (a "magic alias") to achieve an effect that's not possible using either one or the other. That's not the naive user who hasn't learned how to create functions with arguments. Nor are the contructions /lexically/ obscure; the trap is rather in the evaluation's occurring in an unexpected context. Just how dangerous that will be is moot. My impression is that the most dangerous frequently used aliases are those that redefine commands perceived as unsafe; a prime example being rm → rm -i. Cheers, David.