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/

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..