I'd like to pass input from a shell command over to a python script in an alias that uses a shell command.
test.py:
import sys print(sys.argv)
the alias
alias foo='echo $(python test.py $1)'
since $ python cd_alias_test.py hello
would print all the args: ['test.py', 'hello']
I'd expect this alias to do the same. However its stdout is
['test.py'] hello
Which means that the input string is being passed to stdin and not the script's arguments.
How I achieve the intended effect?