Jump to content
  • 0

Question

Posted
Basically, i have this code
#!/bin/bash
echo "Starting cript"
java -cp ./libs/script.jar main.Main > log/script.log 2>&1

What i need to do is make this script self-run. I mean when i run this script in putty, it doesn't run in background, and if i want to do any command, i have to press CTRL+C(exit) - but then this program closes, maybe anyone with more bash knowledge could help?

 

2 answers to this question

Recommended Posts

  • 0
Posted

 

Basically, i have this code
#!/bin/bash
echo "Starting cript"
java -cp ./libs/script.jar main.Main > log/script.log 2>&1

What i need to do is make this script self-run. I mean when i run this script in putty, it doesn't run in background, and if i want to do any command, i have to press CTRL+C(exit) - but then this program closes, maybe anyone with more bash knowledge could help?

 

 

I recommend you read a bit in google is full of solutions.

I 'll explain on the basis of my experience , I recommend pressures instead of CTRL + C (close ) can add & at the end of the code , as this symbol makes it run in the background. Another solution is to press CTRL + Z , which also makes the application run in the background ( STOPPED ) and the command FG build it as well you also get to use the jobs command to show whether or not running , it's easy, just do not want read a little more and wait seated to tell you a solution. So you will not get very far.

 

Sugestion : http://www.thegeekstuff.com/2010/05/unix-background-job/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...