Display command line output

In my program LabVIEW calls an executable using a batch file and this executable returns a string. Is there a way for LabVIEW to be able to view this output string?

hi
I do not know how your batch files run, but you should get it run properly (with "wait until completion = False) before setting it to TRUE.
If your batch files do not even run correctly (with "wait until completion = False), it will hangs when your run the system exec.vi (with "wait until completion = TRUE).
Hope this is not too confusing....
... as it's late now... and Zzzzz..
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com

Similar Messages

  • Displaying command line window in a tab

    I have to display a graphics screen of a simulator that is run through a batch file, in a tab. Is it possible? If yes how might I do so?
    Thanks for you time!

    Is your problem solved yet? If not take a look at this page http://www.labnol.org/software/tutorials/copy-dos-command-line-output-clipboard-clip-exe/2506/
    It might help you
    By using a property node you can copy content from clipboard
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Capturing command line output to a file possible?

    Hi, i am in need of capturing the command line output to a txt file and need some suggestions on how to do it.
    I have two classes, class A is the one with all the methods and outputs text to the command line (using System.out.print). class B is the one that calls the methods and needs to record the command line output to a file.
    Now the problem i face is not all the output is going to be written to a file and not all the output is going to be displayed on the command line. eg. class B will have a way to select the output mode which is either both to a file and command line or just to a file and display nothing on the command line.
    Is what i am asking even possible? Any suggestions would be great!

    Here is a class I found on the forum that does basically what you need. Just change the code that is updating a Document to write to a file:
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class ConsoleOutputStream extends OutputStream
         private Document document = null;
         private ByteArrayOutputStream outputStream = new ByteArrayOutputStream(256);
         private PrintStream ps = null;
         public ConsoleOutputStream(Document document, PrintStream ps)
              this.document = document;
              this.ps = ps;
         public void write(int b)
              outputStream.write (b);
         public void flush() throws IOException
              super.flush();
              try
                   if (document != null)
                        document.insertString (document.getLength (),
                             new String (outputStream.toByteArray ()), null);
                   if (ps != null)
                        ps.write (outputStream.toByteArray ());
                   outputStream.reset ();
              catch(Exception e) {}
         public static void main(String[] args)
              JTextArea textArea = new JTextArea();
              JScrollPane scrollPane = new JScrollPane( textArea );
              JFrame frame = new JFrame("Redirect Output");
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.getContentPane().add( scrollPane );
              frame.setSize(300, 600);
              frame.setVisible(true);
              System.setOut( new PrintStream(
                   new ConsoleOutputStream (textArea.getDocument (), System.out), true));
              System.setErr( new PrintStream(
                   new ConsoleOutputStream (textArea.getDocument (), null), true));
              Timer timer = new Timer(1000, new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        System.out.println( new java.util.Date().toString() );
                        System.err.println( System.currentTimeMillis() );
              timer.start();
    }

  • Parsing java command line output to a gui

    Dear All,
    I am trying to implement a search engine for a project, i have a java file called Searcher.java, which searches for a particular text or sentence and gives the output based on the number of hits on a particular document, the document with the max hits is displayed first and so on,all the documents are are stored in a text file, I am trying to create a GUI for this file, the gui would consist of a text box,submit button,a list and a text area , when a user enters the text to search all the entries are displayed in the list box and upon clicking the individual item in the list the description should open up in the text area.
    The problem i am encountering is that i am not able to parse the output of the searcher.java file onto the GUI, i have no clue as to how to implement it , i would really appreciate it if anyone could help me out.
    the code for Searcher.java is as follows
    import java.util.*;
    public class Searcher {
    /** Specify the work directory !! */
    private static final String rootDir = "C:/HR/GUIAssign/";//on PC
    // private static final String rootDir = "/research/gm/Java/IR/"; // on Unix
    private static final String stopWordFile = "iStopWords.txt";
    private static final String docCollFile = "iDocColl.txt";
    private static final String invertedIndexFile = "ioInvertedIndex.txt";
    private StopWordSet stopWords = new StopWordSet(rootDir + stopWordFile);
    private Stemmer stemmer = new Stemmer();
    private TextTokenizer tok;
    private TextParser parser;
    private InvertedIndex inv;
    /** Creates a new instance of Searcher */
    public Searcher(TextTokenizer tok, TextParser parser) {
    this.tok = tok;
    this.parser = parser;
    ReaderWriter rw = new TextFileReaderWriter(rootDir);
    inv = rw.readInvertedIndex(invertedIndexFile);
    List search(String query) {
    System.out.println("\nSearching for <" + query + ">.");
    List hits = new ArrayList();
    int nbOfDocs = parser.getNbOfReadDocs();
    System.out.println("\nSearching for <" + query + "> among " + nbOfDocs +
    " documents.\n");
    double scores[] = new double[nbOfDocs]; // initial values 0.0
    String term;
    tok.setText(query);
    while(tok.hasMore()) {
    System.out.println("\nNext term: ");
    term = tok.nextToken();
    System.out.println(term);
    if(stopWords.contains(term))
    continue; // this terms can be ignored
    term = stemmer.stem(term); // apply the stemmer to get the root
    System.out.println("\n\nInfo on the term \"" + term + "\":");
    IndexTerm indexTerm = inv.getIndexTerm(term);
    if(indexTerm == null)
    System.out.print("Not in the vocabulary.");
    else {
    System.out.print("It appears " + indexTerm.getTermFreq() + " times, in "
    + indexTerm.getDocFreq() + " documents:\t");
    Iterator itr = indexTerm.getIterator();
    while(itr.hasNext()) {
    DocFreq docFreq = (DocFreq) itr.next();
    scores[docFreq.getDocId()] += docFreq.getFreq() /* / indexTerm.getDocFreq() */ ;
    // create hits from documents that have non-zero scores
    for(int i = 0; i < nbOfDocs; i++)
    if(scores[i] > 0.0)
    hits.add(new Hit(i, scores));
    // sort them in descending order of scores
    Collections.sort(hits, new Hit.CompareByScore());
    return hits;
    * @param args the command line arguments
    public static void main(String[] args) {
    TextTokenizer tok = TextTokenizer.getTokenizer("alpha");
    TextParser parser = new DummyParser(rootDir, tok);
    Searcher searcher = new Searcher(tok, parser);
    List hits = searcher.search("trade and board coffee, stock x is common");
    Iterator it = hits.iterator();
    while(it.hasNext()) {
    Hit hit = (Hit) it.next();
    int index = hit.getDocIndex();
    Doc doc = parser.getDoc(index);
    System.out.println("\n\nDoc " + index + " has a score of: " +
    hit.getScore() + "\n*** " + doc.getTitle() + " ***\n" +
    doc.getText());
    this code runs perfectly and gives the output on the command line
    the code for the GUI is as follows
    import java.awt.* ;
    import java.awt.event.* ;
    import javax.swing.* ;
    import javax.swing.event.*;
    public class HRSearch extends JFrame implements ActionListener {
    // keep references to all event sources
    private JLabel searchLabel;
    private JTextField searchField ;
    private JButton submitButton ;
    private JScrollPane searchScrollPane;
    private JTextArea textArea ;
    public HRSearch()
              Container contentPane = /*this.*/getContentPane( ) ;
              JPanel submitPanel = new JPanel();
              submitPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
              searchLabel = new JLabel("Search: ");
              searchLabel.setEnabled(false);
              submitPanel.add(searchLabel);
              searchField = new JTextField("", 20) ;
              searchField.setEditable(true) ;
              searchField.addActionListener(this) ;
              searchField.setEnabled(false);
              submitPanel.add(searchField) ;
              submitButton = new JButton("Submit") ;
              submitButton.addActionListener(this) ;
              submitButton.setEnabled(false);
              submitPanel.add(submitButton);
              contentPane.add(submitPanel, BorderLayout.NORTH);
    JPanel mainPanel = new JPanel() ;
                   mainPanel.setLayout(new FlowLayout(FlowLayout.LEFT)) ;
              JList searchList = new JList() ;
              // searchList.setEditable(false) ;
              searchList.setVisibleRowCount(20) ;
              searchScrollPane = new JScrollPane(searchList);
              mainPanel.add(searchScrollPane) ;
              textArea = new JTextArea("", 20, 40) ;
              textArea.setEditable(false) ;
              mainPanel.add(new JScrollPane(textArea) /*, BorderLayout.CENTER */) ;
              contentPane.add(mainPanel, BorderLayout.CENTER) ;
    public void actionPerformed(ActionEvent e) {
    String text ; // response to action event
    Object source = e.getSource( ) ;
    if (source != searchField && source != submitButton)
    return; // not interested in other actions
    // get text, trim leading and trailing spaces
    text = searchField.getText( ).trim() ;
    try {
    textArea.setText(textArea.getText() + "\n" + " " );
    catch(NumberFormatException exc) {
    JOptionPane.showMessageDialog(
    this, // address of "parent" or "anchor" frame
    "Not a number !", // the error message
    "Number Format Exception", // title of this modal dialogue
    JOptionPane.ERROR_MESSAGE // nature of this dialoge
    public static void main(String args[]) {
              final JFrame f = new HRSearch();
              // f.setBounds(100,100,500,450);
              f.pack();
              f.setVisible(true);
              f.setDefaultCloseOperation(EXIT_ON_CLOSE);
    i am stuck at this point and dont know what to do , please help me out.
    regards
    harsha

    I'm not positive I understand your problem... but let me recap what I think it is, then provide a solution:
    Your searched program can be run from the command line, and prints out (using system.out) the data you want. But NOW you want to create a GUI class, that intercepts that output, and displays it on the screen, and you can't because its going to the output stream and you're GUI isn't able to get it.
    If this is the case, what you can do is add two constructors to your Searcher class:
    public Searcher()
    this(System.out);
    public Searcher(OutputStream out)
    this.out = out;
    The idea being, that if you don't specify an output stream, the output goes to the console like normal. But if you do specify an output stream, the data gets fed back to you. So then in your GUI, you can do some binding of PipedInputStream and PipedOutputStream so when the Searcher class prints out, it comes right through the pipe into your GUI where you are waiting to read it.
    If this wasn't your problem, sorry :(
    Best,
    -Riyad

  • Asus Laptop (G1, G2, G5, G70, G71) OLED display: Command line utility.

    Greetings.
    Yep. You did read the subject line properly. There is a new command line utility in town.
    To be more exact, there are two small utilities that I have designed for this little OLED -display. (Links at the end of this post)
    To anyone still in confusion, let me show you:
    Some Asus laptops comes with this neat little status display, but few softwares around to utilize them.
    Specially when it comes to the Linux operating system.
    What I've made here, is a simple and easy to use command line utility that communicates with the display.
    But it doesn't stay at "simple". It also has a few advanced features, which is described in detail in the README and their --help sections.
    With this utility and a bunch of simple pixmap images, anyone can easily create messages, animations and transitions without the need of deep knowledge of the underlying system.
    This makes it perfect for boot animations, event updates, status changes and alike.
    Short video-demostration:
    http://www.youtube.com/watch?v=2i8Twa4h_iI
    X11 Pixmap Format
    To get starting, you need a set of pictures.
    You should, and is encouraged to create these yourself, and if you do, please share your creations with us here. I will update a list of your creations in this post accordingly.
    These utilities can, at the moment, only read xpm images. Most drawing programs can handle this today so hat shouldn't be a problem.
    There is a preferred format, but other formats are possible:
    *  Colordepth: 1 bit (Monocrome)
    *  Height: 32 pixels
    *  Width: 128 pixels (for G1 and G2) or 256 pixels (for G5, G70, G71 ...)
    There are a few prepackaged XPM images that can be used any way you see fit.
    GIMP is the tool I used to create the pictures and animations.
    Installation.
    To install: Read INSTALL. Keep in mind: 'bin' and 'conf' folder relies on eachother, so they should stay together. I plan to improve this, but that's another story.
    Permissions: Again. Read the 'INSTALL' file. You need rw-access to two class nodes:
    /sys/class/asus_oled/oled_1/picture
    /sys/class/asus_oled/oled_1/enabled
    Doesn't exist??? ... did you read the INSTALL and README?... aw... well.. here's a hint:
    # modprobe asus_oled && ls -l /sys/class/asus_oled/
    The module should already exist, and if you're running Arch Linux on that laptop with the default kernel, it's already loaded.
    The modules comes with the Linux kernel itself (Staging area). Nothing else needed to be done. Isn't that awesome?
    If you happen to run a custom kernel, reconfigure it and activate 'asus_oled' as a module. Recompile, install and eat icecream.
    (Icecream part is very important)
    Quickstart.
    Once you created your awesome xpm image, you want it to live on the OLED display. This is the command:
    $ asus_oled-ctl --static-picture My-Awesome-128x32-Pic.xpm
    Explanation: '--static-picture' just simply converts and loads a picture onto the display and exits. Nothing fancy really.
    You haven't created a picture yet? .... horrible drawing skills? ...
    Well ... *sigh* ... Try one of the prepacked pictures then. 128x32_archlinux-logo1.xpm should suffice.
    You find it under pictures/logos/
    Success? Yay! Have some more icecream!
    Next thing you might be interested in, is animations.
    Animations is pretty much just a series of static images inserted one after another in a rapid manner.
    So get to it and convert the whole Star Wars saga to a series of 128x32 monocrome XPM pictures...
    ... or just make a short animation of your liking... and SHARE IT!
    Need a neat command to show your animation skills on the display? Here it is:
    (NOTE: There's a bug that causes this utility to have serious trouble with spaces in paths and files. I'm aware of it. Just avoid spaces for now... )
    $ asus_oled-ctl --cycle 50,10 path/to/my/awesome/animation/*
    Explanation: '--cycle' cycles through all the pictures it's given. The argument '50,10' tells it to delay each frame 50 milliseconds, and loop through them 10 times.
    If you instead wanted one loop instead of 10 and decrease the speed to 100 milliseconds per frame? Just change it accordingly:
    $ asus_oled-ctl --cycle 100,1 path/to/my/awesome/animation/*
    Still a bit confused on how the animations should be set up?
    Have a look at the prepacked examples found under pictures/animations/
    Hey! why not test one of the examples out:
    $ asus_oled-ctl --cycle 50,10 pictures/animations/Arch-ripple_loop/*
    Want it to be endless? Set the loop part to 0, and it will loop forever, or until you run out of power. (You can hit CTRL+C to interrupt)
    $ asus_oled-ctl --cycle 50,0 pictures/animations/Arch-ripple_loop/*
    You might have noticed it took a few seconds before the animation started from the point you hit [Enter]. (And that it took some CPU to do it)
    It's because the utility have to convert the images to a more fitting format before it goes ahead.
    Fortunately, there's a remedy to that delay. It's called cached slots. What it means is that one can tell the utility to store the converted animation data in a storage slot for later use.
    Here's how to do it:
    Step 1: Convert your awesome animation, and store it into a named cache-slot called 'MyAwesomeAnimation'.
    $ asus_oled-ctl --generate-cache MyAwesomeAnimation path/to/my/awesome/animation/*
    It will crunch your pictures for a few seconds, and then exit normally.
    Wait.... WHAT??? ... You did convert Star Wars whole saga?... Wow!!!... That will take an eternity to crunch through... =O
    Once it's done (Hopefully this site still lives when it is) we can now see what cache slots we have in the storage:
    $ asus_oled-ctl --show-cache
    There's your Star Wars saga... *erh*.. awesome animation. If you did a full install, you might notice a few other slots too. You can test em out if you'd like.
    Now to play that cached animation:
    $ asus_oled-ctl --cycle 50,5,MyAwesomeAnimation
    Notice how the animation starts almost instantly this time. That's what cache is for.
    Want to delete any of thos annoying and horrible slots?
    $ asus_oled-ctl --delete-cache MyAwesomeAnimation
    Now a few other commands to try out and discover what they do:
    $ asus_oled-ctl --power off
    $ asus_oled-ctl --power on
    $ asus_oled-ctl --clear
    $ asus_oled-ctl --static-picture pictures/devel/ASUS-logo_reversed.xpm
    $ asus_oled-ctl --help
    $ xpm2asus_oled pictures/logos/128x32_archlinux-logo1.xpm
    $ xpm2asus_oled --output ansi pictures/logos/128x32_archlinux-logo1.xpm
    $ xpm2asus_oled --help
    I hope that I've introduced the utilities for you and awaken your interest in this otherwise useless little display with a neat ASUS-logo on it.
    Now get on to it and create some awesome logos and animations for us all to use.
    I will update this utility every now and then, and hopefully include some of your animations with the package.
    The community's contribution list:
    ... *tumbleweed in the wind* ...
    Links
    Download: https://bitbucket.org/SysGhost/asus-ole … .1.tar.bz2
    Documentation (subject to change): https://bitbucket.org/SysGhost/asus-ole … /wiki/Home
    git: https://bitbucket.org/SysGhost/asus-ole … tility.git
    Read README for details. (It's named README for a reason)
    Update:
    Version 0.1.2 - Minor bugfixes.
    Upcoming: 0.2 - Rewritten in python. Twice as fast.
    Last edited by SysGhost (2012-11-23 14:51:16)

  • Mashed/compressed command line output

    This is rather hard to describe, but after installing Arch on a new machine not long ago, I noticed that in the output of certain programs, some characters were partially or entirely hidden behind others.  That is, it appears that certain letters are mostly missing, but little bits of them are still visible behind characters that come later on in the output.  If I select the output with my mouse, and copy and paste somewhere else, the entire output is there...it's just not all visible on the command line.  Though, as I select with my mouse, the specific text my mouse is over becomes visible and other, adjacent characters are hidden.  So far I've seen this running yaourt, as well as in vim (which is really a pain).  I use Konsole.
    Here's a screenshot, showing the output of `yaourt -Ss digikam`:
    Notice how various text fields seem to run into each other, and the end of each field gets clipped.  As I said, I see the same behavior within vim, so it's not limited to the output of any particular program.  Any ideas what's causing this?  Is it a Konsole thing, or could it be related to X somehow, or maybe something else I haven't thought of?

    I am writing a program that runs a load utility via a
    class that returns the load utilities output via a
    string. There is a certain part of this output which
    i need to determine if the program has successfully
    completed. I am looking for suggestions on how to
    accomplish this. Below is an example of the commands
    output.
    Rows Read : 30000
    Rows Rejected : 0
    Rows Loaded : 30000
    Rows Committed: 30000What constitutes a successful run?
    Might want to take a look at the String.startsWith() and String.indexOf() methods:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html

  • Getting command line output dynamically

    I am executing one command line argument through WPF application but not getting any output of command line execution. But if I will execute same command through command line manually then getting out put. I am using synchronous operation and below code.
    System.Diagnostics.ProcessStartInfo procStartInfo =
                        new System.Diagnostics.ProcessStartInfo("cmd", "/C " + commandlinearg);
    procStartInfo.UseShellExecute = false;
    procStartInfo.CreateNoWindow = true;
    procStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
    procStartInfo.WorkingDirectory = strToolsPath;           
    procStartInfo.RedirectStandardOutput = true;
    System.Diagnostics.Process proc = new System.Diagnostics.Process();
    proc.StartInfo = procStartInfo;
    proc.Start();
    result = proc.StandardOutput.ReadToEnd();
    proc.Close();
    --Mrutyunjaya

    Hi Magnus, I am using synchronous operation like below
    System.Diagnostics.Process proc = new System.Diagnostics.Process();
    proc.StartInfo = procStartInfo;
    proc.Start();
    result = proc.StandardOutput.ReadToEnd();
    proc.WaitForExit();
    if output is very huge then in that case is it required to collect in a huge buffer or below code can collect the out put 
    result = proc.StandardOutput.ReadToEnd();
    because I am using also WaitForExit but still I am not getting out put whereas using same code i am getting output for some commands(which gives less output). 
    Mrutyunjaya

  • Command Line Output Directory

    I am trying to generate my help files through the commanline utitlity via a bat file.
    Here is my bat file...
    rem Generates the System output files
    :START
    "c:\Program Files\Adobe\Adobe RoboHelp 8\RoboHTML\RHCL.exe" "c:\Projects\myProj\1.0.0\Development\HelpFiles\MyHelp.xpj" -o
    "c:\userName\Desktop\RoboHelpOutput" -g "c:\userName\Desktop\RoboHelpOutput\log.txt"
    :END
    When I run this, it successfully generates the output files, but it does not generate it in the "c:\userName\Desktop\RoboHelpOutput" directory. Instead, it uses the directory I pointed it at when I generate the output through the RoboHelp UI. I need to figure out why this is ignoring the -o Destination tag in order to be able to work locally and have the help files generated with our automated builds.
    Please Help!!!!
    Thanks in advance!
    hmaprk

    Hi - we are having the same issue. Regardless of what we specify as the output folder, the help file always generates the output on the drive we previously specified in the SSL file.
    SSL:
    <element name="DestinationProjectName" value="X:\doc_4x\html\apps\output\pr\flexi\fpr32.chm" />
    We tried to eleminate the X: to see where the file will generate to. This is the path that showed up on the first wizard screen when I went to generate in RH a few minutes later:
    X:\doc_4x\html\apps\projects\pr\doc_4x\html\apps\projects\pr\doc_4x\html\apps\output\pr\fl exi\fpr32.chm
    Any help in resolving our command line build issue is greatly appreciated!

  • How to display Runtime.exec() command line output via swing

    Hi all, I'm new to java but have a pretty good understanding of it. I'm just not familiar with all the different classes. I'm having trouble capturing the output from a command I'm running from my program. I'm using Runtime.exec(cmdarray) and I'm trying to display the output/results to a JFrame. Once I get the output to display in a JFrame, I'd like it to be almost like a java command prompt where I can type into it incase the command requires user interaction.
    The command executes fine, but I just don't know how to get the results of the command when executed. The command is executed when I click a JButton, which I'd like to then open a JFrame, Popup window or something to display the command results while allowing user interaction.
    Any examples would be appreciated.
    Thank you for your help in advance and I apologize if I'm not clear.

    You can get the standard output of the program with Process.getInputStream. (It's output from the process, but input to your program.)
    This assumes of course that the program you're running is a console program that reads/writes to standard input/output.
    In fact, you really should read from standard output and standard error from the process you start, even if you're not planning to use them. Read this:
    When Runtime Exec Won't

  • Command Line Output Parsing

    I am writing a program that runs a load utility via a class that returns the load utilities output via a string. There is a certain part of this output which i need to determine if the program has successfully completed. I am looking for suggestions on how to accomplish this. Below is an example of the commands output.
    Rows Read : 30000
    Rows Rejected : 0
    Rows Loaded : 30000
    Rows Committed: 30000

    I am writing a program that runs a load utility via a
    class that returns the load utilities output via a
    string. There is a certain part of this output which
    i need to determine if the program has successfully
    completed. I am looking for suggestions on how to
    accomplish this. Below is an example of the commands
    output.
    Rows Read : 30000
    Rows Rejected : 0
    Rows Loaded : 30000
    Rows Committed: 30000What constitutes a successful run?
    Might want to take a look at the String.startsWith() and String.indexOf() methods:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html

  • How to display the contents of a text file on the command line?

    I realize I need to utilize classes from the java.io.* package, but I don't know which ones to use exactly. This is what I would like to do in a nutshell:
    public static void main(String[] args) throws IOException {
    File inputFile = new File( <path to the file>);
    // code that reads data from the above file and is able to
    // append it to  a string object or display it on the command
    // line (System.out.println)
    }Thanks for your time!

    It's pretty easy. Here's a little example that reads a file, stores it in a string, and prints it to the command line.
    import java.io.*;
    public class OpenFile {
         public static void main(String args[]) {
              try {
                   File fileToOpen = new File("something.txt");
                   FileReader fileIn = new FileReader(fileToOpen);
                   BufferedReader br = new BufferedReader(fileIn);
                   String fileContent = new String();
                   String line;
                   while ((line = br.readLine()) != null) {
                        fileContent += line + "\n";
                   System.out.println(fileContent);
                   br.close();
              catch (IOException e) {
                   System.out.println("Exception: " + e);
    }Good luck,
    Alex

  • Capturing the output of a os command line

    I need to capture the output of a os command line executed from one java program and I don't know how can do it.
    For example:
    Runtime.getRuntime().exec("hostid");

    Your suggestion worked very well, just in case that this could interest somebody, this is the complete solution
    Thanks for your help
    import java.io.*;
    public class HostID
    public static void main(String args[]){
    try{
    InputStream in = (Runtime.getRuntime().exec("hostid")).getInputStream();
    byte[] arreglo= new byte[200];
    int cantidad = in.read(arreglo);
    System.out.println(new String(arreglo,0,cantidad));
    } catch (IOException ioe){System.out.println(ioe.getMessage());}
    }

  • Unix command Line input and output

    Has anybody used Forte for now window application. Passing values through
    command line and get put as a return value. I am able to call Forte and
    pass input values but I do not know who to get the return value. Here is
    the shell script that I am running:
    #!/bin/csh
    # Ensure that the correct number of parameters were supplied #
    if (${#argv} < 2) then
    then
    echo "USAGE: ecapp Method Number Parm1 Parm2"
    exit 1
    endif
    ftexec -fi bt:$FORTE_ROOT/userapp/mwapp/cl0/mwapp_0 -fnw -fterm $1 $2
    The start class will return a string value after processing the request. I
    can use task.lgr.putline to output to the screen but that is not what I
    would like to do. I want to get the return value assigned to a variable in
    the shell script. One thing I do not know is that if Forte return a string
    that the script can use. Any help would be appreciated.
    thanks in advance
    ka
    Kamran Amin
    Forte Technical Leader, Core Systems
    (203)-459-7362 or 8-204-7362 - Trumbull
    [email protected]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi,
    Did you try to set Task.Part.OperatingSystem.ExitStatus ? But, the ExitStatus is an integer.
    If you really need a string, I would use ExitStatus to know how it finished and an environment variable (Task.Part.OperatingSystem.SetEnv() to position it in your Tool code) to read the string back in the script.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Url : http://perso.club-internet.fr/dnguyen/

  • HT3924 Target display mode connects but only displays desktop background, no files or command lines

    I have connected my early 2014 MacBook to a late 2012 imac and connected them via Thunderbolt cable.  Pressing Command F2 causes the screen on teh iMac to change to teh MacBook background screen, but does not display any desktop files or command lines.  Any ideas how to fix this?

    Hi tdmone,
    Welcome to the Support Communities!  The resource below may help you with the Target Display Mode options for connecting your Macbook and iMac:
    Target Display Mode: Frequently Asked Questions (FAQ) - Apple Support
    http://support.apple.com/en-us/HT3924
    The table below shows iMac computers that support TDM, the required cables, and the port of the computer to which you are connecting the iMac.
    iMac Model
    Cable Supported
    Port on Source Computer
    iMac (27-inch Late 2009)
    Mini DisplayPort to Mini DisplayPort
    Mini DisplayPort or Thunderbolt
    iMac (27-inch Mid 2010)
    Mini DisplayPort to Mini DisplayPort
    Mini DisplayPort or Thunderbolt
    iMac (Mid 2011)
    Thunderbolt to Thunderbolt
    Thunderbolt
    iMac (Mid 2012 and later)
    Thunderbolt to Thunderbolt
    Thunderbolt
    Are you connecting via the Thunderbolt ports on both computers?
    How do I enable TDM?
    Make sure both computers are turned on and awake.  
    Connect a male-to-male Mini DisplayPort or ThunderBolt cable to each computer. 
    Press Command-F2 on the keyboard of the iMac being used as a display to enable TDM. 
    Note: In Keyboard System Preferences, if the checkbox is enabled for "Use all F1, F2, etc. keys as standard functions keys," the key combination changes to Command-Fn-F2.
    Can I use a third-party keyboard or older Apple keyboard to enable TDM?
    Some older Apple keyboards and keyboards not made by Apple may not allow Command-F2 to toggle display modes. You should use an aluminum wired or wireless Apple keyboard to toggle TDM on and off.
    I hope this information helps ....
    - Judy

  • CohQL command line Tool select query output in file (unix)

    Ho to insert Coherence CohQL command line Tool select query result in file in unix platform. I have tried below query but failed
    query.cmd -s -c -l "select * from 'dist-example'" >myOutput.txt
    I also tried below query, result is displayed in command line but no file is created in folder.
    select * from dist-example >myOutput.txt
    I also tried one more query, result is displayed in command line but no file is created in folder.
    select * from dist-example >/opt/bin/myOutput.txt

    Hi,
    In Unix you should use query.sh instead of query.cmd
    In your case then the command would be smething like:
    query.sh -s -c -l "select * from 'dist-example'" >myOutput.txt
    You can also try using '>>' instead of '>' in order to redirect to a text file.
    Hope this helps.
    -Cris

Maybe you are looking for

  • Could I have some help identifying and fixing dead/stuck/hot pixel?

    Hello, yesterday whilst watching a movie on my Macbook Pro I noticed something on my screen, at first I thought it was just something stuck on the screen but it seems to be an issue with a pixel. I would appreciate help regarding identifying if it's

  • Remote desktop software

    Is there any iPod touch app to control yer pc like remote desktop on the pc? Also how do you stay logged in to this site? It keeps asking me to log in each time I come back and try to post. Is there anyway to have flash work the www?

  • Handling Output in the print program

    All, I have the following issue. We are having  a single custom smartform for printing purchase order used for printing for 32 company codes, Because of this smartform has been tide up with lot of "Conditions" Now we wanted to split this smartform ba

  • How to get the user objects?

    Dear all, How to get all the user objects? i am using Select * From user_objects but it gives me some tables which belongs to oracle such as 'BIN$ZKjpvXfMSOShDJUjxzmiiw==$0' and i do not want these tables to be viewed. is there any way to avoid those

  • Sorting Compilation Albums etc

    I want to sort my music by artist, and view each album together. Where I have a compilation CD, or a CD with a guest artist, if I sort by Artist, I can't see all tracks from the album in the same place. So I painstakingly entered the "Album Artist" f