FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-22-2012, 01:03 AM
Hilco Wijbenga
 
Default How to run a command, then leave the shell open?

Hi all,

Every morning I start konsole, type "emerge --sync", and then go do
other stuff. Some time later I look at the output and usually run
"emerge ... world". I would like to automate that a bit more.

I can use kpart to start konsole on a particular desktop so that's
easy. What I can't seem to get working is the "$SHELL --login" +
"emerge --sync" part.

If I run "konsole --noclose -e emerge --sync" then I get the output I
want but I don't get a prompt. If I run "konsole -e $SHELL --login"
then I get the prompt but, obviously, no emerge output.

How can I combine these two? I would like konsole to run emerge --sync
and then leave a prompt open. Just like what would happen if I did it
all manually. Any ideas?

Cheers,
Hilco
 
Old 02-22-2012, 01:36 AM
Felix Kuperjans
 
Default How to run a command, then leave the shell open?

Hi Hilco,

answers and suggestions inline.

Am 22.02.2012 03:03, schrieb Hilco Wijbenga:
> Hi all,
>
> Every morning I start konsole, type "emerge --sync", and then go do
> other stuff. Some time later I look at the output and usually run
> "emerge ... world". I would like to automate that a bit more.
Just a suggestion: Do you know the porticron script? Combined with a
proper setup of ssmtp, it will sync you portage tree daily (in the
background) and send you an email with all updates, and important
security notes.
> I can use kpart to start konsole on a particular desktop so that's
> easy. What I can't seem to get working is the "$SHELL --login" +
> "emerge --sync" part.
>
> If I run "konsole --noclose -e emerge --sync" then I get the output I
> want but I don't get a prompt. If I run "konsole -e $SHELL --login"
> then I get the prompt but, obviously, no emerge output.
>
> How can I combine these two? I would like konsole to run emerge --sync
> and then leave a prompt open. Just like what would happen if I did it
> all manually. Any ideas?
I don't use konsole, but try out: konsole -e $SHELL -c "emerge --sync &&
$SHELL --login"
> Cheers,
> Hilco
Regards,
Felix
 
Old 02-22-2012, 02:08 AM
Hilco Wijbenga
 
Default How to run a command, then leave the shell open?

On 21 February 2012 18:36, Felix Kuperjans <felix@desaster-games.com> wrote:
> Hi Hilco,
>
> answers and suggestions inline.
>
> Am 22.02.2012 03:03, schrieb Hilco Wijbenga:
>> Hi all,
>>
>> Every morning I start konsole, type "emerge --sync", and then go do
>> other stuff. Some time later I look at the output and usually run
>> "emerge ... world". I would like to automate that a bit more.
> Just a suggestion: Do you know the porticron script? Combined with a
> proper setup of ssmtp, it will sync you portage tree daily (in the
> background) and send you an email with all updates, and important
> security notes.

Thanks, no I did not know about this script.

I checked it out but I prefer to kick the sync off myself (syncing
really slows down the computer). Besides, I have my own little script
that does everything the way I want it. :-)

>> I can use kpart to start konsole on a particular desktop so that's
>> easy. What I can't seem to get working is the "$SHELL --login" +
>> "emerge --sync" part.
>>
>> If I run "konsole --noclose -e emerge --sync" then I get the output I
>> want but I don't get a prompt. If I run "konsole -e $SHELL --login"
>> then I get the prompt but, obviously, no emerge output.
>>
>> How can I combine these two? I would like konsole to run emerge --sync
>> and then leave a prompt open. Just like what would happen if I did it
>> all manually. Any ideas?
> I don't use konsole, but try out: konsole -e $SHELL -c "emerge --sync &&
> $SHELL --login"

Ah, the secret sauce is the quotes. Google had told me not to use
quotes. I must have misunderstood. Still, I thought I had tried
something like that.

Thanks!
 
Old 02-22-2012, 02:26 AM
Nikos Chantziaras
 
Default How to run a command, then leave the shell open?

On 22/02/12 05:08, Hilco Wijbenga wrote:

On 21 February 2012 18:36, Felix Kuperjans<felix@desaster-games.com> wrote:

Hi Hilco,

answers and suggestions inline.

Am 22.02.2012 03:03, schrieb Hilco Wijbenga:

Hi all,

Every morning I start konsole, type "emerge --sync", and then go do
other stuff. Some time later I look at the output and usually run
"emerge ... world". I would like to automate that a bit more.

Just a suggestion: Do you know the porticron script? Combined with a
proper setup of ssmtp, it will sync you portage tree daily (in the
background) and send you an email with all updates, and important
security notes.


Thanks, no I did not know about this script.

I checked it out but I prefer to kick the sync off myself (syncing
really slows down the computer).


It doesn't have to. You can put these in your make.conf:

PORTAGE_NICENESS=19
PORTAGE_IONICE_COMMAND="sh -c "schedtool -B ${PID}; ionice -c 3 -p
${PID}""


Syncing and emerging should be transparent now. You won't even know
it's happening :-)
 
Old 02-22-2012, 07:41 AM
Yohan Pereira
 
Default How to run a command, then leave the shell open?

On Tuesday 21 Feb 2012 18:03:35 Hilco Wijbenga wrote:

> How can I combine these two? I would like konsole to run emerge --sync

> and then leave a prompt open. Just like what would happen if I did it

> all manually. Any ideas?

>

> Cheers,

> Hilco

*

Ok theres probably a better way to do this, but heres goes.

*

create a bash script with what you want to run ie (emerge --sync).

*

now start konsole with konsole with

konsole -e /bin/bash --rcfile <path to script>.

*

alternativly you can create a new konsole profile and add that to the command section and use that profile for this.

*

--

*

- Yohan Pereira

*

The difference between a Miracle and a Fact is exactly the difference

between a mermaid and a seal.

-- Mark Twain
 
Old 02-22-2012, 08:05 AM
Yohan Pereira
 
Default How to run a command, then leave the shell open?

oh*Felix had a better answer*didn't*notice ... ignore mine .


---Yohan Pereira
 

Thread Tools




All times are GMT. The time now is 05:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org