Skip to content

Instantly share code, notes, and snippets.

@jpaulin
Last active April 29, 2022 08:53
Show Gist options
  • Save jpaulin/5c349d139d26bbb5d32b81231c399cf7 to your computer and use it in GitHub Desktop.
Save jpaulin/5c349d139d26bbb5d32b81231c399cf7 to your computer and use it in GitHub Desktop.
EDRA - edit, enable and rehash new bash aliases and settings, faster than ever!
#
# Put below lines your .bashrc or similar shell configuration file.
#
# Thus this 'installs' the edra system as part of your shell environment.
# These lines below are what matter:
#
# Uses file ~/bash_aliases (in your home folder, thus tilde ~)
# for storing aliases.
#
# When you issue 'edra', your favorite editor pops up, and you can edit & save the .rc file
# Then edra script automatically also makes these changes immediately
# effective into your shell.
#
# If you use some other editor than 'vim', then replace vim below:
alias edra='vim ~/.bash_aliases; ba && hash -r'
# ba is for 'source the bash aliases'. This makes your shell read definitions ("source" them)
alias ba='. ~/.bash_aliases; echo Realiased!'
@jpaulin
Copy link
Author

jpaulin commented Apr 29, 2022

Checking out how the edra alias works with a bash shell.
If you have ideas, suggestions, please let me know here! All welcome.

Simplest way to use this is just:

  • first put the above gist text lines into your ordinary shell .rc file (for bash, it is usually ~/.bashrc) - Note: do not REPLACE the file, but insert those lines above there
  • assumes, that you store your bash extra aliases in file ~/.bash_aliases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment