Cannot run double or consecutive commands

Bug #1050576 reported by Pierre
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lxterminal (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I am unable to run a double or consecutive root commands in Lxterminal using scripts.

E.g. in scripts
sh -c "lxterminal --command sudo... & sudo"
sh -c "lxterminal -e ' sudo... && sudo...'"

Lxterminal is a great lightweight console but useless in scripts because there is no option to stay open or run consecutive commands without entering a password multiple times.

I hope this can be fixed, especially important that it is only terminal app in Lubuntu.
---
ApportVersion: 2.0.1-0ubuntu13
Architecture: i386
DistroRelease: Ubuntu 12.04
InstallationMedia: Lubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
Package: lxterminal 0.1.11-2ubuntu1
PackageArchitecture: i386
ProcEnviron:
 LANGUAGE=en_CA:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.2.0-30.48-generic 3.2.27
Tags: precise
Uname: Linux 3.2.0-30-generic i686
UpgradeStatus: Upgraded to precise on 2012-05-21 (118 days ago)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote : Re: [Bug 1050576] [NEW] Cannot run double or consecutive commands

have you tried quoting the command list? i.e.
sh -c "lxterminal --command 'sudo blah & sudo blah blah'"

On Thu, 13 Sep 2012 19:28:47 -0000
Pierre <email address hidden> wrote:

> Public bug reported:
>
> I am unable to run a double or consecutive root commands in Lxterminal
> using scripts.
>
> E.g. in scripts
> sh -c "lxterminal --command sudo... & sudo"
> sh -c "lxterminal -e ' sudo... && sudo...'"
>
> Lxterminal is a great lightweight console but useless in scripts because
> there is no option to stay open or run consecutive commands without
> entering a password multiple times.
>
> I hope this can be fixed, especially important that it is only terminal
> app in Lubuntu.
>
> ** Affects: lxterminal (Ubuntu)
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Lubuntu
> Packages Team, which is subscribed to lxterminal in Ubuntu.
> https://bugs.launchpad.net/bugs/1050576
>
> Title:
> Cannot run double or consecutive commands
>
> Status in “lxterminal” package in Ubuntu:
> New
>
> Bug description:
> I am unable to run a double or consecutive root commands in Lxterminal
> using scripts.
>
> E.g. in scripts
> sh -c "lxterminal --command sudo... & sudo"
> sh -c "lxterminal -e ' sudo... && sudo...'"
>
> Lxterminal is a great lightweight console but useless in scripts
> because there is no option to stay open or run consecutive commands
> without entering a password multiple times.
>
> I hope this can be fixed, especially important that it is only
> terminal app in Lubuntu.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/lxterminal/+bug/1050576/+subscriptions

Revision history for this message
Logan Rosen (logan) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 1050576
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in lxterminal (Ubuntu):
status: New → Incomplete
Revision history for this message
Pierre (pierrewinnipeg) wrote :

I have tried dozens of way, quotes and everything...
Apport failed to install. Sorry, but I cannot provide more.

Try these commands in any terminal. They should open Abiword and Leafpad, but that is not what happens.:

lxterminal --command 'sudo abiword & sudo leafpad'

lxterminal -e "sudo abiword & sudo leafpad"

Thanks for a prompt response.

Revision history for this message
Pierre (pierrewinnipeg) wrote : Config_Home_Lubuntu.txt

apport information

tags: added: apport-collected precise
description: updated
Revision history for this message
Pierre (pierrewinnipeg) wrote : Dependencies.txt

apport information

Revision history for this message
Pierre (pierrewinnipeg) wrote :

I was finally able to install Apport and I ran the report.

Please let me know if you need anything else.

Thanks.

Revision history for this message
karl anliot (kanliot) wrote :

i donno if this is a bug, but you might be able to put your command in a script file and
lxterminal --command "bash myscript"

Logan Rosen (logan)
Changed in lxterminal (Ubuntu):
status: Incomplete → New
Revision history for this message
Pierre (pierrewinnipeg) wrote :

Karl,
The bash script might work, but it makes scripts dependent on a bunch of other scripts. That is complex, clunky, and problematic. Thanks. It might be useful if the problem cannot be solved.

The best thing is to improve Lxterminal and solve the problem for everybody else also.

Revision history for this message
GravityWell (tpresley) wrote :

Thanks for reporting this. I'm fairly new to Linux and was trying to do something similar in Lubuntu and lxterminal and thought I was doing it wrong.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lxterminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Jarno Suni (jarnos) wrote :

As a workaround in Lubuntu and in any release that contains package xterm you could use "lxterm -e" command:
E.g.
lxterm -e 'ls | less'
(Quit by pressing q)
lxterm -e 'ls ; read'
(Quit by pressing <enter>)

As for multiple simultaneous commands as superuser, why not use something like
gksudo "lxterm -e 'command1 & command2'"
so that you have to give password only once?
(Note: With graphical applications it is better to use gksudo instead of sudo.)

Revision history for this message
Pierre (pierrewinnipeg) wrote :

Thanks Jarno.

Multiple commands work with xterm and lxterm is part of the xterm package. When I originally asked the question, only lxterminal was included in Lubuntu.

They should fix lxterminal although since it has other major bugs (like when you try to use it in gtk scripts: if another terminal is opened, everything is screwed) and there seem to be little interest in fixing any of them, I would recommand the LXDE dump it. There are plenty of other terminals out there, including xterm, which I think is even smaller!

Revision history for this message
Lyn Perrine (walterorlin) wrote :

With lxterminal 0.2.0-1 in xenial this seems to have been fixed upstream.

Changed in lxterminal (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.