sawyl: (Default)
[personal profile] sawyl
Happened across an interesting skit which described some clever tricks, magic aliases, that make it possible to short circuit shell expansions. The basic idea is as follows:
  • You have an alias which saves parts of the shell context, changes that context, and then passes the alias's arguments to a helper shell function.
  • The helper shell function restores the original shell context which was saved by the alias (either before or after doing something with the arguments it was given).
  • Thus, the arguments passed to the alias undergo variable and wildcard expansion in the altered shell context, and yet the running of the alias as a whole leaves the shell context as it was.

I'm not convinced that magic aliases are useful for anything, but that doesn't undermine the coolness/perversity of the idea...

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 5th, 2026 04:05 pm
Powered by Dreamwidth Studios