Exploring zsh features made me want to figure out some of the history-editing wizardry. (Bash has similar history tricks, I just never bothered to dive too deeply into them.)
If you want to experiment with history expansion a bit, you can echo the result instead of executing it:
hostname:~/dir% ls /some/long/path/to/file_0.1-2_i386.changes
hostname:~/dir% echo !?ls?:s/-2/-3/
echo ls /some/long/path/to/file_0.1-3_i386.changes
In this case, [...]
Read the rest of this entry »
I’ll take an array over a giant switch-case statement any day.
The array definition will be more compact and easier to see all at once.
Defining actions in an array enforces uniformity.
You can put checks in the code to automatically verify that the array definition is complete. (I.e. verify it contains a definition for every item it [...]
Read the rest of this entry »
Since the beginning of time, all the cool kids have had really cool shell prompts. It’s a great place to display helpful information, and zsh has features that let you have a flexible, informative, unobtrusive prompt.
Read the rest of this entry »
From The Peanut Gallery