Skip to content

Instantly share code, notes, and snippets.

@abathur
Created March 31, 2021 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abathur/05adb07aff65353b152155336c9d46a8 to your computer and use it in GitHub Desktop.
Save abathur/05adb07aff65353b152155336c9d46a8 to your computer and use it in GitHub Desktop.
alias ~preprocessor?
$ /usr/bin/env -i PATH="$PATH" /run/current-system/sw/bin/bash <<EOF
> shopt -s expand_aliases
> alias ls="$(type -p ls)" grep="$(type -p grep)" sed="$(type -p sed)"
> foo(){
> echo ls grep sed
> ls
> ls | grep heh
> }
> declare -pf foo
> unalias ls grep sed
> declare -pf foo
> foo
> EOF
foo ()
{
echo ls grep sed;
/run/current-system/sw/bin/ls;
/run/current-system/sw/bin/ls | /run/current-system/sw/bin/grep heh
}
foo ()
{
echo ls grep sed;
/run/current-system/sw/bin/ls;
/run/current-system/sw/bin/ls | /run/current-system/sw/bin/grep heh
}
ls grep sed
LICENSE README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment