LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-30-2004, 04:08 PM   #1
lazkyr
LQ Newbie
 
Registered: Jul 2004
Location: GREECE
Posts: 2

Rep: Reputation: 0
Exclamation Java with Shell Scripts


I have a file of this format(it is from a packet sniffer-the packets are sent from a host to another):

YY-MM-DDrotocol(tcp,udp,icmp):SRC IP:SRC PORTEST IPEST PORT

It is a file with 16000 lines and i want to create a GUI,so that i can analyze the data that i have in that file.I want to use Java to create the GUI,but i think that it is better if i use a script instead.Is there a way that i can use a shell script(eg.if i want to see only the tcp connections or if i want to see the traffic that is created from a specific host) and then with the results of that process,using Java to create a nice graffical interface?You can tell that i want the script to do the 'dirty job' and Java the 'nice one'.I am asking if i can do that and how....
I am looking forward to your answers.

Lazaros
Greece


PS.Visit Greece for the Olympic Games
 
Old 07-30-2004, 04:30 PM   #2
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 31
Un-tested code:
Code:
try
{
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec( "/usr/bin/frobnicate" );
    BufferedReader buf = new BufferedReader(
        InputStreamReader( proc.getInputStream() ) );
    String line;
    while ( ( line = buf.readLine() ) != null )
    {
        System.out.println( "Output from frobnicate: " + line );
    }
}
catch ( IOException e )
{
    System.out.println( "We're boned. " + e.getMessage() );
}

Last edited by johnMG; 07-30-2004 at 04:42 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running shell scripts from Java cmpich Programming 1 04-19-2005 04:36 AM
running shell scripts using Java niravk8 Programming 2 02-09-2005 09:42 AM
Java Shell / Batch Scripts GenericProdigy Programming 4 11-18-2004 09:00 AM
shell scripts and installing java.. scoob8000 Linux - Software 2 07-12-2003 11:13 AM
shell scripts nautilus_1987 Linux - General 3 08-30-2002 03:12 AM


All times are GMT -5. The time now is 06:43 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration