Today I Learned

hashrocket A Hashrocket project

zsh variable editing

Lets say I made a typo in an important environment variable and I wanted a quick fix, just to see if yes, that was indeed why my application wasn't working.

$ echo $RAILS_ENV
> porduction
# ^^^ YIKES ^^^

The Z shell has a builtin program called vared that helps you edit an existing environment/shell variable.

$ vared RAILS_ENV
porduction

Now you are in an editing context, you can edit the value with all your configured command line editing tools. Fix the error, hit RETURN, and you're good!

See More #command-line TILs