Skip to main content
2 of 3
added 96 characters in body
adamency
  • 423
  • 3
  • 12

I found the answer:

The key is using the builtin eval. Doing this will achieve the wanted behavior (more precisely running the command in the actual shell we're logged in, instead of a subshell):

> eval $(grep lsdir ~/.bashrc)
> type lsdir
lsdir is aliased to `ls -d */'
adamency
  • 423
  • 3
  • 12