I'm trying to automate installing Erl using shell script. Here's my shell script-unzip OTP-18.0-rc1.zipcd otp-OTP-18.0-rc1export ERL_TOP=`pwd`./otp_build autoconf./configureecho $ERL_TOPecho ################### MAKE ###################make -j8 && make installecho Creating soft links......ln -snf /home/user/erlang/otp-OTP-18.0-rc1/bin/erl /usr/bin/erlln -snf /home/user/erlang/otp-OTP-18.0-rc1/bin/erlc /usr/bin/erlc# Install other packagesI'm trying to execute this script on a remote machine this way-ssh root@host_ip 'bash -s' < my_script.sh However the script exits after the make command, without creating the soft links.I've verified that there's no error during install process. Also the script works perfectly fine when executed locally on that same system.Interestingly, if I modify the script to put make command on two separate lines like this-make -j8make installThe script exits without doing make installWhat am I missing here?
Shell script being executed on remote machine exits after running make command
bash;shell script;make
The problem is you can have only 1 stdin, and so if your bash script runs a command that reads from stdin at all, it will gobble up lines from the script.Try resetting stdin for the make commands, eg:( make -j8 && make install ) </dev/null