Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

The reinstall.sh bash script file in the Contrib directory doesn't work in Ubuntu 17

0 votes

When I am following the instructions in the programmers guide, and run the ./reinstall.sh bash script file in the Contrib directory, nothing seems to happen. I see no errors, but no files/folders get deleted, and no repos are pulled down from github. I'm running Ubuntu 17.10

Looking at the script, I narrowed the problem down to these lines:

if [ "x$1" = "x-y" ]; then
    read -p "Do you want to nuke, fetch and patch contributed packages [y/N]? "

if [ "X$REPLY" = "Xy" ]; then

When I remove those lines, the script runs perfectly! Who can help me find the problem with these bash scripting lines?

Tip: For alternative ways to script a Y/N prompt in bash, here is the question on StackOverflow: https://stackoverflow.com/questions/3231804/in-bash-how-to-add-are-you-sure-y-n-to-any-command-or-alias

asked Mar 9, 2018 in Programmer Questions by RichLewis007 (240 points)

1 Answer

0 votes
Thanks for letting us know. I am not sure what to fix in here, though.

The goal was that if you run "reinstall.sh -y" (which is run by other scripts) it will just assume yes and not ask anything, otherwise it will prompt. Are you getting the prompt message (the read -p command)? Because it is y/N you do need to answer "y", and if you just press return the default (no) is assumed (this is what we mean by showing a lowercase y and uppercase N).

thanks for the stack overflow link!
answered Mar 20, 2018 by JeVois (46,580 points)