Simple if - else logic problem?? - Newbie
Why doesnt this work? - just looking to understand if/else statements (am checking for Mutt, then asking to install, no install commands yet, just using echo to see if it will work logically)
Code:
#!/bin/bash |
Quote:
Please let us know... Edit: Please use [code][/code] tags around script(s) or their output. Thank you. |
Quote:
So dpkg gives true/false, if true read input, if false exit, if input Y do something, if input anything else exit.....Help appreciated. UBUNTU::./mutt + dpkg -s mutt ./mutt: line 12: conditional binary operator expected ./mutt: line 12: syntax error near `"You' ./mutt: line 12: ` echo "You need Mutt for program to work/n/n"' |
You missed a quote here:
Code:
if [[ "$entry1" == "Y" || "$entry1" == "y" ]] |
Quote:
|
Just to add, bashes if can also take a function directly so you can place your dpkg statement straight the first if:
Code:
if ! dpkg -s mutt 2>error |
Quote:
|
All times are GMT -5. The time now is 10:10 AM. |