|
|||||||
This is a discussion on "shell scripting" in the Top Mud Sites MUD Coding forum : The shell script i'm using to startup the mud i work for was written for someone else, a friend of the mud's owner. I know a little unix only so i thought i would ask for some advice with this, if you guys don't mind. Here's what the script looks like now. [code] #!/bin/csh limit core unlimited set port = 4000 if ( "$1" != "" ) set port="$1" cd area if ( -e ../data/shutdown.txt ) rm -f ../data/shutdown.txt while ( 1 ) set index = ... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
New Member
|
The shell script i'm using to startup the mud i work for was written for someone else, a friend of the mud's owner. I know a little unix only so i thought i would ask for some advice with this, if you guys don't mind. Here's what the script looks like now.
[code] #!/bin/csh limit core unlimited set port = 4000 if ( "$1" != "" ) set port="$1" cd area if ( -e ../data/shutdown.txt ) rm -f ../data/shutdown.txt while ( 1 ) set index = 1000 while ( 1 ) set logfile = ../log/$index.log # if ( -e $logfile ) gzip -9 $logfile # if ( ! -e $logfile.gz ) break @ index++ end if ( -e core ) then mv core ../coredumps/`date +%m-%d-%y.core` endif # rm ../data/ips.txt ../src/MiddleEarth $port >&! $logfile if ( -e ../data/shutdown.txt ) then rm -f ../data/shutdown.txt exit 0 endif sleep 8 end [/quote] so, i understand most everything it does, and just have a few questions. i assume ( -e blah.txt) evaluates to true if a file is present? the problem we're having is that we never get the log file in gzip form if an old one is present, it just keeps getting overwritten. ideally we would have logs named "1000.log" up to "1010.log" or higher, depending on how many times the mud restarts. also, what exactly would the ">&!" do? i know ">" will put the output in the file, and "&" will run it in the background(maybe yes?) but "!" i have no clue on. Thanks, -Emit |
|
|
|
|
|
#2 | ||
|
Senior Member
|
Quote:
Quote:
That's because the code that gzips the file is commented out! Immediately afterwards, it checks if the gzipped file exists, and if it doesn't, it stops before it increments the index count -- that's why it overwrites the file afterwards. Simply remove the two "#" comments at the front of the line, and you should be fine =). |
||
|
|
|
|
|
#3 |
|
New Member
|
hah! no kidding. well, that certainly explains it.
thanks a bunch |
|
|
|
|
|
#4 |
|
Member
Join Date: May 2002
Location: Linköping, Sweden
Posts: 31
![]() |
Argh, a shell-script in csh!
|
|
|
|
![]() |
| Thread Tools | |
shell scripting - Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Accounts | fatemud | MUD Coding | 0 | 09-19-2006 07:40 PM |
| Unzipping a MUD into the shell | NotL337 | MUD Coding | 4 | 04-12-2006 01:12 AM |
| Shell for use | Terron | Advertising for Staff | 0 | 07-26-2004 01:17 AM |
| Which scripting language? | Gakusei | MUD Coding | 9 | 03-14-2004 09:39 AM |
| Scripting | gutterzombie | MUD Builders and Areas | 6 | 01-28-2004 02:30 PM |
|
|