You are not logged in.

#1 2005-02-22 20:06:26

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,444

simple bash question: how to script into new shell?

I want to have a script that opens a new terminal and calls some commands. I am to stupid. :oops:


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#2 2005-02-22 20:10:50

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: simple bash question: how to script into new shell?

a new terminal? try "xterm -e"

as in:

# xterm -e "ls -rl /dev"

Offline

#3 2005-02-22 20:35:52

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,444

Re: simple bash question: how to script into new shell?

... well, this was it. Thank you. I was sure, the terminal would stay up, but it is closed after running the commands. Last issue. smile


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#4 2005-02-22 20:40:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: simple bash question: how to script into new shell?

hmmm, well what are you trying to do? you could pop up the terminal and output whatever it is through "less"

# xterm -e "ls -lr /dev | less"

and the output will be there until you hit "q"

though you may need some other options to less to have it read from stdin

Offline

#5 2005-02-22 21:03:32

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: simple bash question: how to script into new shell?

Use "read" to wait for input (e.g. enter).

xterm -e "ls -lr /dev; read"

Offline

#6 2005-02-22 22:42:46

alterkacker
Member
From: Peoples Republic of Boulder
Registered: 2005-01-08
Posts: 52

Re: simple bash question: how to script into new shell?

Or maybe you want to use 'xmessage' as in:

'ls -lr /dev | xmessage -file -'

That pops up a nice little window containing the command output with an 'Okay' button to close it down again.

Offline

#7 2005-02-22 22:55:30

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: simple bash question: how to script into new shell?

alterkacker wrote:

Or maybe you want to use 'xmessage' as in:

'ls -lr /dev | xmessage -file -'

That pops up a nice little window containing the command output with an 'Okay' button to close it down again.

yeah but xmessage looks like crap IMHO  wink

Offline

#8 2005-02-23 16:27:44

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,444

Re: simple bash question: how to script into new shell?

*Smack*

This should be ok. I was tired of typing "makepkg foobar", and so I wrote a tiny dirty nautilus script to do that for me. Unfortunately, it worked in the background. Not bad, if you KNOW your package is ok, but in case of errors.

Thank you all.  smile


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#9 2005-02-23 19:19:50

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: simple bash question: how to script into new shell?

Pink Chick wrote:

*Smack*

This should be ok. I was tired of typing "makepkg foobar", and so I wrote a tiny dirty nautilus script to do that for me. Unfortunately, it worked in the background. Not bad, if you KNOW your package is ok, but in case of errors.

Thank you all.  smile

hmm sounds like an interesting idea... i don't use nautilus myself... but i could see it being cool to double click a PKGBUILD file and have it run makepkg...

Offline

#10 2005-02-24 00:55:28

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: simple bash question: how to script into new shell?

Another idea:

aterm -e bash -c "ls -l; bash"

This runs bash after last command so you can still play with the aterm window  roll

Offline

#11 2005-02-24 01:02:42

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: simple bash question: how to script into new shell?

asif you dont all use screen and just disconnect the session tongue

Offline

Board footer

Powered by FluxBB