Bug 179863

Summary: commands called with sudo in scripts are ignored
Product: [I don't know] kde Reporter: 501337
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: adaptee, Robert.nr1
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description 501337 2009-01-07 00:17:16 UTC
Version:            (using KDE 4.1.3)
Installed from:    Fedora RPMs

It's not possible to have commands with sudo prior to it in scripts, if you want to run them by doubleklicking it, with Alt-F2 or from an menu entry, because these commands will be ignored and never be called.
If you try it from an open console, it works fine.

A little example:

#!/bin/bash
kwrite
exit 0

This script works. No problems.
If you try

#!/bin/bash
sudo kwrite
exit 0

it only works in an open console.
Doubleklicking the file cause nothing.

I always have to run konsole first, to make such a script work properly.

I don't think this is a wilful behaviour.
Hope it will be fixed.
Comment 1 Robert Ã…kerblom-Andersson 2009-03-05 00:04:29 UTC
Hi, I just tested this bug and it does not seam like a bug to me!

When I use the exact code that your referring to it works out of the box for me.... :) 

(Arch Linux, KDE 4.2.1)

Regards
Comment 2 501337 2009-03-05 12:31:31 UTC
Thanks for testing.
Seems to be a fedora-specific problem.
It still occours with the KDE-4.2.0-packages.

Regards
Comment 3 Jekyll Wu 2011-09-22 23:39:20 UTC
That is because when double clicking a script, dolphin run it silently insteand of running it in konsole.See comment #8 in bug #225563 for detail.

*** This bug has been marked as a duplicate of bug 225563 ***