I recently switched from tcsh to bash, and I'm used to being able to do things like sudo `alias netstat` but since alias gives name=value in bash, I can't do this anymore. Is there an equivalent in bash, so I don't have to do sudo `alias netstat | sed -r "s/.*='(.*)'/\1/"`?
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
You're trying to have bash expand aliases after
...and |
|||
|
|
|
Bash stores its list of aliases in the associative array
There's still a lot that won't work with this, like e.g. nested aliases. |
|||
|
|
.bashrc. Problem solved. – Daniel Beck♦ Jan 1 '12 at 9:10