maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   How do I open a new xterm and run a command from a script? (https://talk.maemo.org/showthread.php?t=67965)

FRuMMaGe 2011-01-06 17:25

How do I open a new xterm and run a command from a script?
 
Title says it all. I have a script that I've been using in Ubuntu that I would like to port to my N900. It needs to be able to open several xterm windows simultaneously and run a different command in each one. I've tried:

osso-xterm 'command goes here'

Which works in xterm but not from a script for some reason.

Also, how can I end the current command but NOT end the whole script. Ctrl+C worked on Ubuntu but on my N900 it exits the whole script.

MaddogG 2011-01-06 17:38

Re: How do I open a new xterm and run a command from a script?
 
Quote:

Originally Posted by FRuMMaGe (Post 913389)
Title says it all. I have a script that I've been using in Ubuntu that I would like to port to my N900. It needs to be able to open several xterm windows simultaneously and run a different command in each one. I've tried:

osso-xterm 'command goes here'

Which works in xterm but not from a script for some reason.

Also, how can I end the current command but NOT end the whole script. Ctrl+C worked on Ubuntu but on my N900 it exits the whole script.

To execute a command in a new xterm window:
osso-xterm -e <command>
For the second part of the question, could you please explain better what do you want to do?

gregoranderson 2011-01-06 17:41

Re: How do I open a new xterm and run a command from a script?
 
I think this post might be what you are looking for (you wish for the xterm window to stay open after executing the command, correct?):

http://talk.maemo.org/showpost.php?p=311926&postcount=4

FRuMMaGe 2011-01-06 18:01

Re: How do I open a new xterm and run a command from a script?
 
Quote:

Originally Posted by MaddogG (Post 913406)
To execute a command in a new xterm window:
osso-xterm -e <command>
For the second part of the question, could you please explain better what do you want to do?

Tried this method. It just opens it in the current xterm window when run from a script.

As for the second part, it's a script which automates the functions of the aircrack suite. It needs to be abe to run airodump to identify APs, then on Ubuntu, I pressed Ctrl+C which brings me back to the main function of m script so I can enter the details of the access point to interface with.

However, on my N900 Ctrl+C just exits the entire script

MaddogG 2011-01-06 18:10

Re: How do I open a new xterm and run a command from a script?
 
Quote:

Originally Posted by FRuMMaGe (Post 913431)
Tried this method. It just opens it in the current xterm window when run from a script.

Strange...it works for me. I made a script that simply launches vim (osso-xterm -e vim) and it opens it in a new xterm window.

FRuMMaGe 2011-01-06 18:22

Re: How do I open a new xterm and run a command from a script?
 
Quote:

Originally Posted by MaddogG (Post 913434)
Strange...it works for me. I made a script that simply launches vim (osso-xterm -e vim) and it opens it in a new xterm window.

Just made a very basic script and your command worked. I'll have to just experiment. Thanks

EDIT: Turns out it wasn't working because I was ending the command with the "&" symbol. This was necessary in Ubuntu but not on the N900

marlaw 2011-01-06 18:36

Re: How do I open a new xterm and run a command from a script?
 
Hey mate - care to share that script ?

FRuMMaGe 2011-01-06 20:11

Re: How do I open a new xterm and run a command from a script?
 
Quote:

Originally Posted by marlaw (Post 913467)
Hey mate - care to share that script ?

Sure thing. When I am done tweaking I will release it into the wild :)

You will need the bleeding edge packet injection drivers installed already for it to work though, but currently the features include:

> Enabling/disabling monitor mode
> Scanning for APs
> Authentication with APs
> Package injection
> Chopchop attacks
> Fragmentation attacks
> Building custom ARP (after chopchop or fragmentation)
> Bombarding AP with custom ARP
> Decryption of cap files (and ultimately cracking the wep key)
> Bruteforce dictionary attacks (for wpa keys, but don't expect this to be very fast on the N900)

I am currently suffering from 1 problem which I think will be easy to solve. When I run a command from the script in another xterm, the new xterm is based in the /home/user directory. This is strange because on Ubuntu it maintained the current working directory. Is there a simple way around this?

MaddogG 2011-01-06 23:25

Re: How do I open a new xterm and run a command from a script?
 
Simpliest solution:
osso-xterm -e cd <dir> && <command>

moudy91 2011-01-19 06:31

Re: How do I open a new xterm and run a command from a script?
 
hey guys i need some help with the xterm but i ont know how to create it.
i use so much ping to access my access machine but every time i have to type root and then ping xxx.xxx.xxx.xxx and this it take me time, i need it as a beecon script, can anyone help me with this please.:confused:

humble 2011-01-19 12:36

Re: How do I open a new xterm and run a command from a script?
 
i say install suder so instead of "root"'whatyouwants' it will be "sudo whatyouwant" ...one command mabe this might help.

moudy91 2011-01-25 20:21

Re: How do I open a new xterm and run a command from a script?
 
hey.
but i prefer the root command but in both ways i want to add my command on the queen beacon so just a command to put it in queen widget so i can access the xterm and immediate access to the ping.
so waiting till someone figure out my command that am waiting for .
thank you guys, and best regards.


All times are GMT. The time now is 11:27.

vBulletin® Version 3.8.8