so this is a really weird error. I've tested it on two installs of GNU/Linux, namely Arch Linux and Linux Mint 17.1. I've got a bash script I'm working on, and it starts with an if-statement.
if which apt-get &> /dev/null; then x="foo"
elif which yum &> /dev/null; then x="bar"
elif which pacman &> /dev/null; then x="baz"
It works fine on my Arch installation (with bash v4.3.33), but on my Mint installation (bash v4.3.11), it completes the if-statements without incident, but after the if-statements there's a prompt for user input and bash immediately prints from stdout (even though I'm fairly sure I redirected it to /dev/null). It looks like:
Choose an option: /usr/bin/apt-get
where "Choose an option: " is my prompt. This doesn't occur on Arch, and when I switched the order around to
if which pacman &> /dev/null; then x="foo"
elif which apt-get &> /dev/null; then x="bar"
the trailing output after my prompt stopped appearing.
Is there something I'm missing here?
Aucun commentaire:
Enregistrer un commentaire