Skip to main content
added 2 characters in body
Source Link
ilkkachu
  • 148.1k
  • 16
  • 268
  • 441

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 */'

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 */'

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 */'
added 96 characters in body
Source Link
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 */'

I found the answer:

The key is using the builtin eval. Doing this will achieve the wanted behavior:

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

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 */'
Source Link
adamency
  • 423
  • 3
  • 12

I found the answer:

The key is using the builtin eval. Doing this will achieve the wanted behavior:

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