Bash: Don't wait for command to exit

I asked this question in an earlier post but it was in the wrong section, my post was...
How would I script the following commands below?
WAM$ nc 127.0.0.1 4271
STREAM #KeyboardInput
PORT 2043 #Result of typing STREAM , would like to PORT="2043" as variable
^C #Exit KeyBoardInput
WAM$
In between these two posts, I came up with a partial solution such as
PORT=`echo 'STREAM' | nc 127.0.0.1 4271 | awk '{print $2}'`
but this command never exits so...
How do I exit this comand once I have the PORT variable set?

Do you have a process listening to port 4271 on your system?
You might need to arrange for nc to be interrupted after some short time. Maybe
(echo STREAM | nc 127.0.0.1 4271 & sleep 10 && kill %1) | awk...

Similar Messages

  • How to call a ALSB Proxy Service and don't wait for his response. Publish M

    Hi,
    I have a Proxy Service called PS1 that will invoke and another Proxy service Called PS_ProcessingNode that invokes 10 differents webservices during the orchestration and takes about 2 minuts.
    I would like that if invoke PS1 that will invokes PS_ProcessingNode (asyncronously) and immediatly PS1 will return "OK" (don't wait for the response of PS_ProcessingNode) .
    For simulate this scenario I am testing with:
    - PS_Processing is a WSDL without response that has a JavaCallout with a Sleeper of 10 seconds.
    - PS invokes with "Publish action" to PS_ProcessingNode but is waiting for PS_Processsing finish. I don't want this beahivour.
    How I can do it for PS doesn't wait for the response of the PS_ProcessingNode?
    Thanks.

    - PS invokes with "Publish action" to PS_ProcessingNode but is waiting for PS_Processsing finish. I don't want this behavior.
    I'm glad you have a solution using JMS. But still Publish action should not wait for response. If you are seeing that behavior, you can contact Support with an SR to get it fixed.
    Manoj

  • Don't wait for loading image

    Hi
    I'm trying to load an image, but don't wait for it to complete !
    In an applet, there is a method called "getImage" which does this job. But I've got no applet !
    Does someone know how to do this ?
    Thank's for all comments !
    Freddy

    Is there any limitation for the image size by using
    Toolkit.getImage()?
    We have a problem when tried to load a image with 5M size
    and only had a partial of the image displaied. Any comments?

  • Wait for command prompt - Enter-PSSession

    Enter-PSSession -ComputerName ServerName
    Restart-Service DNS -PassThru
    Exit-PSSession
    I am trying to restart the DNS Server service on several remote machines using a foreach loop.  The problem is the the script does not wait until the command prompt shows up after executing the "Enter-PSSession -ComputerName ServerName". 
    I have not been able to fine a way to tell the script to wait for the prompt before continuing the script.   Thank you for any assistance that can be provided.

    You can use
    Invoke-Command rather than entering a PS-Session.
    Something like this may do what you need:
    $servers = @("Server1.fqdn.example.com","Server2.fqdn.example.com","Server3.fqdn.example.com")
    $scriptblock = "Restart-Service DNS"
    foreach ($server in $servers) {
    Invoke-Command -ScriptBlock $scriptblock -ComputerName $server
    Replace the server names in $servers with your actual server names. This assumes of course you have PSRemoting enabled which you would need for the PSSessions.
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • LightSwitch HTML: Don't wait for active promise operations when navigating between screens

    Navigation between screens is halted (and the loader is shown) until any active promise operation has completed.
    This becomes an issue when a screen started a long loading operation, but the user wants to exit out of that screen. It is easy to cancel promise operations that I started myself, since I have control over when the operation completes. But I don't see any
    way to do it for operations started by the framework itself (such as any collection property of a screen).
    Is there any solution to this problem?

    This becomes an issue when a screen started a long loading operation, but the user wants to exit out of that screen.
    There isn't method available to cancel the navigation between screens, you need look into your project, and check why it takes long time to load.

  • Things that should be in the next update... please don't wait for 2.0

    I've been using adobe products a long time and I have to say that I am a little disappointed there has not been more thought put into things that should just work in a v1 product.
    Here is the list:
    Ingest window should be able to be able to take up the full screen.  At a minimum, it should remember the last size. My paths get somewhat long and this is very frustrating to continually have to resize the window or panes every time I ingest.
    Ingest should put the files in the bin selected when I hit ingest.  It always puts them at the root.  To make matters worse, keyboard shortcuts that are used to select files in almost any program like SHIFT+HOME do not work.  I have to click, scroll to the bottom and shift click the last file to select a range.  Then drag all the clips to the target bin.  Borrow the code from Premiere
    Keyboard shortcuts for clip navigation.  Logging clips with keyboard shortcuts is a godsend and this is one thing that I love about Prelude.  Anyone who has to do a lot of logging will tell you these keyboard shortcuts are imperative to a smooth workflow.  This is especially true if you have to log hundreds of clips like I do.  Next clip, previous clip when editing from the navigation tree or in a roughcut would be extremely helpful.  If I am in a roughcut, I can easily get into a clip, but not back out to the roughcut where I was.  The only way I have found is to click on the roughcut name in the timeline window.
    Re-linking moved media - FAIL.  Since this product is supposed to let different people log media, it seems crazy that the program can not re-link it.  Very few people in this world store there files in the same absolute path.
    Lack of updates.  Makes me wonder if Adobe is committed to this product.  Having a really long time between iterations is hard on your users.  At this point I have no clue if any of these features will ever be added.
    I have spent a lot of time in this program and it is on the verge of being great.  I personally think that before you start adding new features, you should fix some of the things that make it hard to use.

    Thank you for your post and your passion for Prelude. Input from customers like you is how we can improve out product.
    I do have a few comments and questions for you about your experience. Also, many of the items you have listed are already part of Prelude.
    Replies to your list:
    1.  The Ingest Dialog can be sized to fill your entire screen. Simply drag-drop the edges to resize. This size is also remembered on subsequent launches. This has been in the product for quite some time – what version of Prelude are you running? Currently we have made the following releases: Prelude 1.0, 1.01, 1.02 and 1.03. Our v2.0 has been announced and revealed at NAB last week and is coming out soon with many more enhancements and improvements. Rest assured that Adobe is committed to this product – as you will see with this new release.
    2.  Ingesting into the selected BIN is part of our upcoming release that was revealed at NAB. I'm currently on a Mac so cannot test the SHIFT+HOME shortcut, but Prelude does support CTRL/SHIFT selection options to make selection easier. I'll look into the HOME and END options as well. If they are missing we certainly want them added.
    3.  Glad you find the keyboard driven workflow beneficial. We had a lot of customer feedback early in our 1.0 days that this was a must. Adding support for clip selection in the Project Panel to open and log clips is something in our backlog we would also like to deliver because as you say it is very useful and saves time. We are also reviewing our Clip/Roughcut UI and workflow. Don't have anything to report yet other than this is an area we are focusing on.
    4.  Relinking is possible in Prelude 1.03. We've added additional relinking support in our 2.0 that provides relinking in rough cuts as well. If you are not yet on 1.03 please use the free update and let us know how it works for you.
    5.  As mentioned above, we have 3 updates posted last year for our 1.0. And 2.0 is coming out soon.
    Please continue to share with us your thoughts and ideas for improving Prelude. We have an aggressive feature TODO list but are always looking for more direct input to help us properly prioritize what's part of our next delivery.
    Thanks!
    Michael

  • Don't wait for the Intel Core i7 CPU!!!

    Anybody contemplating a new system with the Core i7 CPU better be warned! (Jim, are you listening?).
    Due to the architecture of the X58 chipset, which does not allow for separate voltages for the CPU and memory, warnings about permanent damage to the core i7 are rampant.
    The core i7 can NOT handle voltages over 1.65V. However, most DDR3 memory chips require MORE than 1.65V, sometimes up to 1.80V. In that case permanent damage to the core i7 is the result. It will be fried.

    >"One of the biggest concerns about Bloomfield X58 motherboards were previous reports that X58 boards will have to use the same voltage for Vcore, CPU and Vmem, the memory on the board. In previous reports, we learned that first revision of the boards had these two things Vcore and Vmem synchronous.
    >We learned that motherboard manufacturers will be able to separate the CPU and memory voltages, and yes, this means that you will be able to set the voltage on your CPU independently from the one on your memory.
    >This will certainly make the overclocking much easier, as you wont burn your CPU with 1.8V voltages that you might need for some ultra faster DDR3 memories. You can expect that the next Asus, MSI, Gigabyte boards, among the others, comes with separate Vmem and Vcore settings."
    Seems Asus chose not to separate them for their first gen P6T, but the option is there for future revisions and other mobos.
    In any event, I had no trouble finding appropriate memory for this board. Shouldn't be an issue if one is careful about matching parts.
    Still, this is a good warning, as I was not aware of the problem.

  • How to invoke BASH shell and execute a command in that shell in Windows 98

    Hello, I have a problem and if somebody will help me, I will be very glad. Thank you.
    I am using BASH shell on Windows 98 OS by means of CYGWIN. And I want to invoke this BASH shell and execute a preprogrammed command in the shell (./scan fileName.txt) from a JAVA program. But so far, I am not sucessful. I can not read or write anything from / to BASH shell. It either blocks and freezes (When I use waitFor( ) ) or appears and disappears without executing scan command (When I do not use waitFor( ) ). My code is like this:
    // This method is used for compiling a file.
    // It invokes BASH shell and executes "./scan fileName.txt" command
    public void compileFileMethod () {
    try {
    Process proc = ( Runtime.getRuntime() ).exec ("C:\\MyDocuments\\CYGWIN.BAT); //I also tried to add -c ./scan fileName.txt after .BAT );
    // I also tried to write "C:\\MyDocuments\\BASH.EXE" but it did not help
    OutputStream ostr = proc.getOutputStream();
    BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter (ostr) );
    InputStream istr = proc.getInputStream();
    BufferedReader br = new BufferedReader ( new InputStreamReader (istr) );
    InputStream errorStr = proc.getErrorStream();
    BufferedReader errorBr = new BufferedReader ( new InputStreamReader (errorStr) );
    bw.write("scan case40.10.txt"); /* I am trying to input the scan command to the shell,but it is not working*/
    bw.flush();
    Vector list = new Vector (1) ;
    String str;
    while ( (str = br.readLine() ) != null) {
    list.addElement(str);
    } // End of while
    Enumeration enumForList = list.elements();
    while ( enumForList.hasMoreElements() ) {
    String tempString;
    tempString = ( String ) enumForList.nextElement();
    System.out.println(tempString); // I am trying to read the outputs of the scan command but it is not reading (I can not see any output)
    I tried with and without waitFor( ), it did not work
    // wait for command to terminate
    proc.waitFor();
    // close streams
    br.close();
    bw.close();
    errorBr.close();
    } // End of try
    catch ( IOException ioe ) {
    JOptionPane.showMessageDialog (null, "Input / output error occured while compiling file ", "Error", JOptionPane.ERROR_MESSAGE);
    } // End of catch
    catch ( SecurityException se ) {
    JOptionPane.showMessageDialog (null, "Security error occured while compiling file ", "Error", JOptionPane.ERROR_MESSAGE);
    catch ( InterruptedException ie ) {
    JOptionPane.showMessageDialog (null, "Interruption error occured while compiling file ", "Error", JOptionPane.ERROR_MESSAGE);
    } // End of method compileFileMethod
    // Thank you for your helps and time.

    You cannot invoke BAT files directly, you have to invoke the program that run those files which is your Windows 98 shell. For example (under windows 2000), i would invoke "cmd.exe sricpt.bat some args", rather than "script.bar some args".
    Hope this will help you out.

  • Jakarta HTTPClient , dont wont to wait for a response.

    Hi there.
    I wonder if I can do that , I want to send a post\get request to another server but I don�t want to wait for a response from it.
    Actually, I want to continue with my program regardless to the response and don�t want to be delayed while waiting.
    How can I do it?
    Hope I made myself clear, thanks.
    Shlomi

    spawn a Thread that will send the request. When it's time to process the response, check the Thread to see if any response was returned from the server.
    example
    public class MyThread extends Thread{
        private String response = null;
        private int status = 0;
        private boolean complete = false;
        public void run(){
             // TODO: et the response from the server
             // set the response and status and complete (synchronize all variable when doing this)
        public boolean isComplete(){
            return complete;
        public String getStatus(){ return status; }
        public String getResponse(){ return response; }
    public class Demo(){
        public static void main(String args[]){
            // do some work
            MyThread thread = new MyThread();
            thread.start();
            // do some more work (don't wait for server response
            // now it's time to get the response
            while (!thread.isComplete()){
                try{   Thread.sleep(1000); } // sleep for 1 second
                catch (Exception e){ }
            String response = thread.getResponse();

  • Sending a request to a servlet without waiting for a response

    Hi,
    I have a client application that needs to send information to a servlet for processing. I would like to be able to send the information in question without having to wait for a response from the servlet. The reason for this is that I want to speed up the "sending" process. I know that http communication is based on TCP which is a connection-oriented network protocol, but I thought maybe there was a work-around to this.
    Thanks in advance for your help,
    Chris

    There r two ways to do this. First, if you can modify the application simply don't wait for the response do whatever you want and ignore the response. If you need the response in order to continue you will have to wait, but you can do this in a separate thread, while the main thread can do other things.
    Second, if you can't modify the application but you can modify the servlet, make the servlet respond as quick as possible, doing the work after having answered. Once again if the application needs the results of the process there is no way, you'll have to wait.

  • Flash player, to update via Adobe or wait for Apple

    Usually, I just wait for Apple to include an update in one of their updates that come out. Currently, flash player 9.0.28 is what I am using (PPC), and that came with one of the latest updates from them.
    I know that their is a slightly newer point version out available on the Adobe's website.
    Any thoughts if it is wiser to just let flash updates come in via Apple, or just down the latest flash player from adobe??

    Apple Software Update doesn't update third party software and Flash Player is no exception.
    The most current version of Flash is 9.0r47 July 10, 2007:
    http://www.versiontracker.com/dyn/moreinfo/macosx/11622 or
    http://www.adobe.com/support/security/bulletins/apsb07-12.html
    Now, it could be that Apple got permission from Adobe to include their software in one of its updates and the quote does give that impression, but I would not expect these events. Since I didn't do a before and after inspection after the 4.9 update I have no way to test.
    http://docs.info.apple.com/article.html?artnum=61798
    10.4.10 was released June 20, 2007 so we may have to wait until the next "security" update to see if Apple also includes this Flash update, too.
    Me? I don't wait for Software Update to fix third party issues.
    Posted, also, with no intent of disrespecting your thoughts on this matter.

  • HT204406 Hello,  I have songs that show they are "Waiting" for download from the cloud but they are greyed out.  Some songs in one album are done others in the same album will not download. It is not a time function because i have been working on this for

    Hello,  I have songs that show they are "Waiting" for download from the cloud but they are greyed out.  Some songs in one album are done others in the same album will not download. It is not a time function because i have been working on this for weeks. I have allowed my compter to run for days and the songs are still not accessible.  I have a Match subscription and Match is working.  If I click on the "Genre" link the greyed out songs show that they are ready for download from the cloud but I cannot download them.  I have downloaded over 1500 other songs, so I am trying to understand what is going on here. I would appreciate any help anyone can give me.
    Thanks

    I did think about that and if I have to I will do that, however there are about 50 songs. I have closed and reopened iTunes several times and I am sure that I have the latest version. It fails right away but I can click on the cloud download icon and download the song that it failed on ... therefore it is not that song "or any one song" causing the issue. Any ideas?

  • They sent me a serial number for a windows version of PS Elements when I ordered a mac version.  The serial number doesn't work, not surprisingly, but they don' t seem to care.  I have tried the chat line and have waited for almost a day with no response.

    They sent me a serial number for a windows version of PS Elements when I ordered a mac version.  The serial number doesn't work, not surprisingly, but they don' t seem to care.  I have tried the chat line and have waited for almost a day with no response.  What should I do?

    Look here
    Order product | Platform, language swap

  • My screen load times have slowed down to a crawl. I have to wait and wait for a page to load. (I know --dial -up) It used to be much faster a month ago before 5.0. Is it FireFox or do I look to Yahoo for the problem? I don't know how to sort it out.

    I use dial-up, FireFox 5.0, Yahoo addition 1.8. My screen load times have slowed down to a crawl. I have to wait and wait for a page to load. (I know --dial -up) It used to be much faster a month ago before 5.0. Is it FireFox or do I look to Yahoo for the problem? I don't know how to sort it out. Using Vista

    I'm having the same problem. Dreamweaver is supper slow. Uploading and downloads from the server... any server I use two different servers. It times out all the time. Menus are slow too.
    I'm on a MAC Pro, 6 gigs of ram no issues with anything else. I have talked to Apple they have checked everything for me. They say it's Dreamweaver. I've noticed the Dreamweaver is talking to the FTP even when I'm not doing anything.
    I've tried cleaning out my MAC caches, turning off file check and check out. Still really slow. I've worked with Dreamweaver for 6 years never any issues like this before. 18 seconds to upload a 4 kb file. 11 seconds to download the same file.

  • Whenever I try to sync my ipod, it'll say that it's syncing and then "waiting for changes to be applied" when it reaches step 5, then it closes and nothing happens. I don't know what to do :(

    Whenever I try to sync my ipod, it'll say that it's syncing and then "waiting for changes to be applied" when it reaches step 5, then it closes and nothing happens. I don't know what to do

    Hi, There
    What do you mean nothing happends? because after step 5/5 the sync is complete and it should go back to the normal top screen of itunes. Is this what is happning? of is it freezing on step 5?
    Message was edited by: Scott\'y

Maybe you are looking for

  • Looking for LabVIEW part time job ,Beijing China

    Seeks the LabVIEW part time job ,Beijing China  The following is the simple introduction,I hoped it can help you to understand me. I had worked for more than 5 years in the China Aerospace Science & Industry Corp. I was engaged in research and develo

  • Document printing very very small in corner of page

    My pdf s are printing very very small in the corner of the Page.  This just started yesterday.  I cant figure out in any of my settings why this would have started.  It is also intermittent meaning that it does not happen with all documents.

  • System.out to file

    Hi ! Could somebody tell me, how I can forward all System.out .println and System.err.println Messages from my Java modules (EJB, Servlets) to differenet files respectively. Thanks. Steve

  • XML SQL Utility & ROW-Tag

    Hi, I have a question about the XML SQL Utility. Must I have the <ROOTDOC> and <ROW> TAG's in my XML-Document to insert the Document with the Utility in my Database, or can I use a random defined TAG as start TAG, e.g. the <BOOK_ID>. XML-Document: Bo

  • Sync ipod to new comp

    i've just brought a new computer, and when trying to sync it with my ipod touch its says ill loose all my paid apps, is there anyway around this?