LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 07-25-2005, 05:38 PM   #1
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
unreal tournament cache cleaner script


Sorry for double post

Dont know if any UT players out there but I'm looking for a script to move downloaded files into the proper dirs, aka a cache cleaner.

Someone gave me a script but doesnt work:
Code:
#!/bin/sh

target=/mnt/str/ut
cmd="mv -v"

cd ~/.loki/ut/Cache || exit 1
echo '[Cache]' > cache.ini.new
cp cache.ini cache.ini.bak.$$ # never know.. ;)
grep '=' cache.ini | awk -F '=' -v cmd="$cmd" -v target="$target" 

function moveit(fromhere, tothere)
{
tothere="""target""tothere""";
print "[ -f "tothere" ] && echo \ \ \ "tothere" already there! || "cmd" ""fromhere".uxx" "tothere | "sh";
}
{
#print $1" "$2; # testing
else if(match($2,".unr$")) { moveit($1, "/Maps/"$2 ); }
else if(match($2,".umx$")) { moveit($1, "/Music/"$2 ); }
else if(match($2,".uax$")) { moveit($1, "/Sounds/"$2 ); }
else if(match($2,".u$")) { moveit($1, "/System/"$2 ); }
else if(match($2,".utx$")) { moveit($1, "/Textures/"$2 ); }
else printf $1"="$2"n" >> "cache.ini.new";
}
END { close("sh") }'

mv cache.ini.new cache.ini
keeps giving awk usage printout and shows error in function:

./cacheconv: line 11: syntax error near unexpected token `fromhere,'
./cacheconv: line 11: `function moveit(fromhere, tothere)'

unfortunately I havent much experience with shell scripting so apart from editing it to show my dir structure I can do little else here
 
  


Reply



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
unreal tournament cache cleaner script dive Linux - Software 1 07-25-2005 05:35 PM
Unreal Tournament.. Help PLEASE IrcSystmzz Linux - Games 2 05-04-2005 08:02 PM
Unreal tournament huno Linux - Games 5 11-04-2003 11:28 AM
Unreal Tournament Nightmare Linux - Software 8 09-30-2003 09:46 AM
Unreal Tournament fatboyjim Linux - Software 7 06-07-2002 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 05:42 AM.

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
Open Source Consulting | Domain Registration