Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've finished installing a Team Fortress 2 server on my Debian server, and I'd like to create a bash script to start my server without having to run ./srcds_run -game tf -maxplayers 32 every time I want to start it. This file is located in /home/steam/orangebox.

I've tried created a bash script (named run.sh) like this:

#!/bin/bash
/home/steam/orangebox/./srcds_run -game tf -maxplayers 32

and I've done chmod -x run.sh and tried to run it, but when I run it, I get bash: ./run.sh: Permission denied returned.

What do I need to change to make this bash script work?

share|improve this question
    
You mean chmod +x run.sh? –  Bobby Aug 16 '12 at 15:07

1 Answer 1

up vote 2 down vote accepted

Assuming you have the rights to run it..

#!/bin/bash
/home/steam/orangebox/srcds_run -game tf -maxplayers 32

A single . is used for the current directory, .. for a level up, etc. There is no need to add it when you are using the full path.

If interested, some additional information on the dot commands can be found here.

share|improve this answer
    
Oh wow, I feel silly for not figuring that out. It works great now! Thank you! –  John Aug 16 '12 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.