Loading ...
Sorry, an error occurred while loading the content.

Executing programs in a network unix shell

Expand Messages
  • Wright, John - Textron Financial
    Hi, I use NTP as my source code editor, and a unix shell comand line to execute the program on a server. I have developed a clip to bring the unix shell to the
    Message 1 of 6 , Jul 9 11:19 AM
    • 0 Attachment
      Hi,

      I use NTP as my source code editor, and a unix shell comand line to execute
      the program on a server. I have developed a clip to bring the unix shell to
      the front using ^!FocusApp Host: clip command, followed by the ^!Keyboard
      command to enter the program name and hit enter (^!Keyboard #prognam#
      ENTER). This problem is, the ^!ActivateApp is the next instruction in the
      clip, which immediately takes me back to NTP, before the unix program
      completes. How can I not return to NTP until the program within the shell
      has completed? I don't want to shut down the unix shell window, so
      ^!ShellWait won't do the trick.

      Does anyone have any ideas?

      John
    • jaytee556
      Try using the ^!Wait command in your clip. ... How can I not return to NTP until the program within the shell
      Message 2 of 6 , Jul 9 11:23 AM
      • 0 Attachment
        Try using the ^!Wait command in your clip.


        --- In ntb-clips@yahoogroups.com, "Wright, John - Textron Financial"
        <JWright@t...> wrote:
        > Hi,
        >
        How can I not return to NTP until the program within the shell
        > has completed? I don't want to shut down the unix shell window, so
        > ^!ShellWait won't do the trick.
        >
        > Does anyone have any ideas?
        >
        > John
      • jeff scism
        ^!Keyboard #prognam# ENTER isn t there a built in delay function that tell the program to wait 2000 ms ( or however many you type) that can be put right into
        Message 3 of 6 , Jul 9 12:13 PM
        • 0 Attachment
          ^!Keyboard #prognam# ENTER

          isn't there a built in delay function that tell the program to wait 2000 ms ( or however many you type) that can be put right into the clip as a delay?
        • Wright, John - Textron Financial
          Sure, that would be fine if I knew how long the program is going to run. ... From: jeff scism [mailto:scismgenie@adelphia.net] Sent: Friday, July 09, 2004 3:14
          Message 4 of 6 , Jul 9 12:33 PM
          • 0 Attachment
            Sure, that would be fine if I knew how long the program is going to run.

            -----Original Message-----
            From: jeff scism [mailto:scismgenie@...]
            Sent: Friday, July 09, 2004 3:14 PM
            To: ntb-clips@yahoogroups.com
            Subject: Re: [Clip] Executing programs in a network unix shell


            ^!Keyboard #prognam# ENTER

            isn't there a built in delay function that tell the program to wait 2000 ms
            ( or however many you type) that can be put right into the clip as a delay?







            Yahoo! Groups Links
          • Alan
            Hi, Unless you are on Linux or Unix running Wine or like fashion so as to run Notetab on Linux then, instead of that, I ll assume you are on Windows and that
            Message 5 of 6 , Jul 9 9:23 PM
            • 0 Attachment
              Hi,

              Unless you are on Linux or Unix running Wine or like fashion so as to
              run Notetab on Linux

              then, instead of that, I'll assume you are on Windows and that what you
              are calling a Unix shell is instead a Windows or DOS like command
              console such as cmd.exe and that through such console you are accessing
              the Unix machine, a process/task/etc. via the network on the Unix machine.

              The process on the Unix machine is not a local Windows process.

              I suspect that Notetab has no way to detect when a non local process has
              ended. But Notetab can when it comes to local Win process.

              Let's see here: Instead of focus app, how's about instead have Notetab
              or Perl do a command line launch of cmd.exe (in the hope that when the
              process is done that the cmd.exe window would close which Ntab should
              able to detect that the cmd.exe window closing since it's local)

              But the problem might come that Windows perhaps not able detect when a
              non local process ends so as to allow the cmd.exe window to close down.

              You might have to end your clip prior to the activateapp line.

              Alan.


              Wright, John - Textron Financial wrote:
              > Hi,
              >
              > I use NTP as my source code editor, and a unix shell comand line to execute
              > the program on a server. I have developed a clip to bring the unix shell to
              > the front using ^!FocusApp Host: clip command, followed by the ^!Keyboard
              > command to enter the program name and hit enter (^!Keyboard #prognam#
              > ENTER). This problem is, the ^!ActivateApp is the next instruction in the
              > clip, which immediately takes me back to NTP, before the unix program
              > completes. How can I not return to NTP until the program within the shell
              > has completed? I don't want to shut down the unix shell window, so
              > ^!ShellWait won't do the trick.
              >
              > Does anyone have any ideas?
              >
              > John
            • thefrank
              hi john, you asked for ideas so here goes... one way: from NTP: in the shell script that you need to execute include a trigger for an event that will occur
              Message 6 of 6 , Jul 10 9:55 AM
              • 0 Attachment
                hi john,

                you asked for ideas so here goes...

                one way:

                from NTP: in the shell script that you need to execute include a
                trigger for an event that will occur when all the previous processes
                have finished running.

                another way:

                from NTP: write a PHP webpage that will execute the shell script.
                include clip language that uploads [FTP] the file then calls the
                browser to open the webpage thus calling the shell script exec. PHP
                has built-in system functions. some will allow the shell script to
                execute completely and then move on to the next step.

                the triggered event:

                the output from the event must be recognizable by NTP on your local
                sys. you could send an email to a specific address then POP locally.
                you could update a webpage and read this from the NTP clip. the
                specific text you slurp from the output can then be used as a
                variable back in NTP clip to fork the next path [e.g. if A then B
                else C].

                the same shell script would vary from sh, csh, tsch, bash, and one
                might be better than another for your particular use.

                of course the above workaround only functions if you are also online
                while your main NTP clip is running.

                PHP system functions:
                http://us2.php.net/manual/en/ref.exec.php

                shell script help:
                http://vertigo.hsrl.rutgers.edu/ug/shell_help.html


                regards,

                tf
                http://www.thefrank.com
              Your message has been successfully submitted and would be delivered to recipients shortly.