Skip to main content
Became Hot Network Question
added 6 characters in body
Source Link

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and execute directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ${HOME} &&ACTION_DIRECTORY wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." happen "endlessly"? (which I stop it with CTRLC+C)
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and execute directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ${HOME} && wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." happen "endlessly"? (which I stop it with CTRLC+C)
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and execute directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ACTION_DIRECTORY wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." happen "endlessly"? (which I stop it with CTRLC+C)
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

deleted 2 characters in body
Source Link

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and executingexecute directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ${HOME} && wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." happen "endlessly"? (which I stop it with CTRLC+C) happen "endlessly"?
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and executing directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ${HOME} && wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." (which I stop it with CTRLC+C) happen "endlessly"?
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

I often execute raw versions of remote Bash scripts in GitHub with this pattern:

wget -O - https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> | bash 

Generally I can do it without problems but since I have added the following code to a certain script I get an endless loop of echo (it often occurs even if I just copy-paste it from GitHub to the terminal and execute directly):

while true; do read -p "Example question: Do you wish to edit the PHP file now?" yn case $yn in [Yy]* ) nano PROJECT/PHP_FILE; break;; [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done 

I can at least partly solve the problem with something like:

cd ${HOME} && wget https://raw.githubusercontent.com/<username>/<project>/<branch>/<path>/<file> && source FILENAME && rm FILENAME 

Which indicates that the | bash piping at least worsens the problem because the problem always happens with it.

Why would echo "Please answer yes or no." happen "endlessly"? (which I stop it with CTRLC+C)
Do you find any problem either in the single lined execution command and/or in the while true; do case esac done?

edited title
Link

Executing a remote script from a code repository, which includes caused causes endless loop

Source Link
Loading