The Daily Build

Icon

Software Development, version 3.0

zsh history expansion

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

Read the rest of this entry »

Data vs Code

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

Read the rest of this entry »

Set Your zsh Prompt

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 »