Skip to content

Bash Script Help

Featured Replies

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?

 

 

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.