2 ms·
Man.. I'm always skeptical of doing things like this. It's one of those things that just comes to rear its ugly head in the future on a machine/user that doesn'
by bpchaps 11y ago
Man.. I'm always skeptical of doing things like this. It's one of those things that just comes to rear its ugly head in the future on a machine/user that doesn't have the alias configured.
Recent example - I wrote a bash script using many of the fancy parameters of lsof to map my work infrastructure's network. The code ran on my arch desktop, but as soon as it was run across the environment.. oh my god the stderr.
Eventually bit the bullet, logged onto the oldest centos4 machine and wrote the silly thing from there in sh. It ended up being significantly better than the bash version, too. :)
/tangent
- mintplant 11y agoThat's why I made using rm into an error, instead of aliasing it directly to the trash command. Now that I've trained myself to use trash instead of rm, if I'm on a system without it installed, the worst that can happen is a "command not found" message.
- rdancer 11y agoYour problems were using GNU extensions, instead of writing in POSIX-standard subset, not knowing what the standard was, and not testing. None of which apply to the grandparent!
- bpchaps 11y agoYeah, should've been 10x more clear. What I meant to say was that by using aliased commands for something as widely used as rm, it's easier to forget the nuances and cause some serious issues. A better example might've been rsync, where it's incredibly easy to wipe a directory if you forget a leading slash with the right flags.