Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-30-2004, 05:08 PM   #1
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):


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.


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

Rep: Reputation: 32
Un-tested code:
    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 05:42 PM.


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 05:36 AM
running shell scripts using Java niravk8 Programming 2 02-09-2005 10:42 AM
Java Shell / Batch Scripts GenericProdigy Programming 4 11-18-2004 10:00 AM
shell scripts and installing java.. scoob8000 Linux - Software 2 07-12-2003 12:13 PM
shell scripts nautilus_1987 Linux - General 3 08-30-2002 04:12 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:15 AM.

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