LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-26-2012, 02:42 AM   #1
TheSmallRock
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
CD Path and Execute New Process - Shell


Hello,

I'm working an a game control panel for SA-MP.
For start I wanna do a START and a STOP button using shell script.

Code:
#! /bin/bash

cd /var/zpanel/hostdata/****/samp/RolePlay/

nohup ./samp03svr &
This code works on terminal . But when I use it in a .sh file I get this error :

Quote:
sh ./start.sh
: not found 2:
cd: 3: can't cd to /var/zpanel/hostdata/*****/samp/RolePlay/
: not found 4:
nohup: appending output to `nohup.out'
nohup: failed to run command `./samp03svr': No such file or directory
root@server1:/var/zpanel/hostdata/*****/public_html/leading-fun_com/game#
What I'm doing wrong ?

Thanks .
 
Old 10-26-2012, 05:53 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Can you show us the script code, those errors don't seem to match the above code.
I also recommend adding the debug cmd set -xv thus
Code:
#!/bin/bash
set -xv

cd /var/zpanel/hostdata/****/samp/RolePlay/

nohup ./samp03svr &
Incidentally, note that there should be NO spaces in the '#!/bin/bash' cmd.
 
1 members found this post helpful.
Old 10-26-2012, 10:12 AM   #3
TheSmallRock
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
That was the code I used ...
---

I don't get errors anymore . but it's not starting the server.

I use this script to kill samp03svr :

Code:
lsof|grep /var/zpanel/hostdata/********/samp/FunPlay/| awk '{print $2}'|xargs kill
Is good because kills only the wanted app but when I wanna start it with :

Code:
#!/bin/bash
set -xv

cd /var/zpanel/hostdata/*****/samp/RolePlay/

nohup ./samp03svr &
(Your code) nothing happens.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] shell shell to execute commands for pgrep linux833 Programming 11 09-07-2012 12:01 AM
Linux command to get Process name & Process executable path ArunChacko Fedora 2 08-26-2011 12:09 PM
Shell script for reading a particular process contineously from process table vinaykori Linux - General 2 05-29-2009 07:52 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 04:47 AM
problem with binding process and than execute another process chapa Programming 0 08-27-2003 04:47 AM


All times are GMT -5. The time now is 07:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration