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...

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

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 05:38 am
Powered by Dreamwidth Studios