生の入力を受け取るPythonファイルを実行するシェルスクリプトを作成しようとしています。Pythonスクリプトは、基本的に次の行に沿っています。
def main():
name=raw_input("What's your name?")
print "Hello, "+name
main()
シェルスクリプトでスクリプトを実行し、入力を自動的にフィードするようにします。Python関数が返すものからシェル入力を取得する方法や、入力を使用してPythonからシェルを実行する方法をたくさん見てきましたが、この方法ではありません。基本的に、私は次のようなことをしたいだけです。
python hello.py
# give the python script some input here
# then continue on with the shell script.