4 ms·
What's the scenario?
by lambdaba 3y ago
What's the scenario?
- TylerE 3y agoSomething sets $PAGER to “rm -rf /“ or something along those lines. Really I’d be more worried about accidental invocations. Aliases are not scoped, so if you’re dealing with one of those programs with non standards option handling and uppercase single character switches…
- lambdaba 3y agoI actually use `alias -g L='| nvimpager'`, As for accidental invocations, yeah I agree it feels dangerous, but in a few hundred thousand lines of shell history since I set them, never had a problem.
- TylerE 3y agoHaven’t had a problem, or haven’t noticed you’ve had a problem? I kid - but only partially. What I really wish for is some sort of tool that would let me pipeline like that, but also easily examine each step in the chain for sanity. Sort of a workbook for shell.
- lambdaba 3y agoAuto-expanding aliases seems like it would help: function expand-alias() { zle _expand_alias zle self-insert } zle -N expand-alias bindkey -M main ' ' expand-alias
- deleted 3y ago[deleted]
- arp242 3y agoTons of things use environment variables like EDITOR or PAGER, and tons of things can "inject" "rm -rf ~" or whatnot. But if they can inject that, they can probably also go all sorts of other nefarious things. There is nothing special about a global alias here. And an accidental typo is not really a big deal, certainly not an "injection possibility".