0

Note this is sourceed, so this is not a shell script. The Bash version is 5.1.4.

How to recreate:

Create a file named "p"

linky(){
comdll="cat"
shopt -s expand_aliases
alias modavar="$comdll"
echo "$argin" | modavar #| getlinks "$argin" | sort -u

}

Then run:

echo "source p ; linky https://duckduckgo.com" | bash --norc
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
lnee_94
  • 25
  • 6
  • Aliases don't work in noninteractive shells unless you explicitly turn the feature on. – Charles Duffy Sep 01 '21 at 00:42
  • ...and why _would_ you turn it on, when you could just use a function instead? `modavar() { local args; printf -v args '%q ' "$@"; eval "$comdll $args"; }` – Charles Duffy Sep 01 '21 at 00:42
  • (of course, that's more redirection than is usually appropriate, and it'd be better to define `comdll() { cat "$@"; }` instead of `comdll="cat"` absent a very compelling reason to do otherwise). – Charles Duffy Sep 01 '21 at 00:46

0 Answers0