in reply to In Linux how to kill the Prompt

Hi karthik.raju,

In Linux once the Perl script get complete of its execution, then how to close that current command prompt

Which command prompt? can you explain your question in detail so that we can help you better!

Update:

For your system command issue try below

Append this string to your command:  >&- 2>&- <&-
>&- means close stdout
2>&- means close stderr
<&- means close stdin

system("ssh buildteam\@xx.xx.xx.xx 'sh /a/bbb/JBoss7/jboss-as-7.1.1.Final/bin/standalone.sh -b 0.0.0.0 > &- 2>&- <&- &'");

SSH connects stdin, stdout and stderr of the remote shell to your local terminal, so you can interact with the command that's running on the remote side. As a side effect, it will keep running until these connections have been closed, that's why your main program does not print the string after system() call.


All is well

Replies are listed 'Best First'.
Re^2: In Linux how to kill the Prompt
by karthik.raju (Acolyte) on Feb 19, 2015 at 07:56 UTC
    Hi Vinoth,

    I want close the Prompt on which the perl is running,

    my intention is, my perl script has to start and run the Jboss server in the background.

    once it get started i need to close the command prompt that is opened for this perl script.

      Then use exec when calling your perl script like this: exec your_script.perl as suggested here.

      Cheers, Sören

      Créateur des bugs mobiles - let loose once, run everywhere.
      (hooked on the Perl Programming language)

Re^2: In Linux how to kill the Prompt
by Anonymous Monk on Feb 19, 2015 at 11:04 UTC
    In Linux once the Perl script get complete of its execution, then how to close that current command prompt

      In Linux once the Perl script get complete of its execution, then how to close that current command prompt

      No use repeating your question, please read my answer here or there.

      You may understand that Perl, when it has already finished, cannot do any more for you, how unsatisfying that is.

      That is why you add the unix/linux exec command to your call to the perl script, when you start it.

      Cheers, Sören

      Créateur des bugs mobiles - let loose once, run everywhere.
      (hooked on the Perl Programming language)

      In Linux once the Perl script get complete of its execution, then how to close that current command prompt(a paragraph)