0

I have a shell script that updates my system, installs some packages, etc. I want to run a python program from my shell script. My shell script looks something like this:

#!bin/bash
sudo python3 /OCMS/src/setup.py

And the Python script:

print('Question #1')
print('Do X')
print('Do Y')
dl_choice = input('Enter Answer here ')

I have the shell script and the python script in github, and when I do

curl https://raw.githubusercontent.com/XXX/XXX/master/bashsetup.sh | sudo bash

the input gets answered automatically and it errors out with

EOFError: EOF When reading a line
khelwood
  • 55,782
  • 14
  • 81
  • 108
SadFarm1
  • 16
  • 2
  • A similar question was asked a few weeks ago: https://stackoverflow.com/questions/62609724/why-is-the-bash-script-functioning-differently-if-i-execute-it-directly-and-exec `input()` reads the next line of bash script. That `curl ... | bash` is a bad practice anyways, stop doing that. – oguz ismail Jul 19 '20 at 19:17
  • Is there anything better than piping it into bash? – SadFarm1 Jul 19 '20 at 23:29

0 Answers0