I'm trying to run the following script on an install of Fedora 20.#!/bin/bashpassword={password}echo $password | sudo -Sk /bin/bash -c '[[ $EUID -eq 0 ]]'[[ $? -ne 0 ]] && zenity --error --text failed. || zenity --error --text success.When trying to run from a terminal emulator, it reports success, but when double clicking the script from a file manager (Thunar in this case), it reports failure.On some other distros (e.g. Debian Wheezy), I get a consistent behaviour.Why would that be the case and what should I do to solve this problem?
sudo command is unsucessful when invoked from file manager
fedora;sudo
In the /etc/sudoers file (accessible with visudo), look for requiretty. You can turn this off for the program with:Defaults!/path/to/program !requirettyIn your case - you are using bash, so this path would be whatever you get from which bash.