LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


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

Rep: Reputation: Disabled
unreal tournament cache cleaner script


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

Last edited by dive; 07-25-2005 at 05:30 PM.
 
Old 07-25-2005, 05:35 PM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Original Poster
Rep: Reputation: Disabled
Meant to post this in Linux - Games :/
 
  


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 - Games 0 07-25-2005 05:38 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

All times are GMT -5. The time now is 05:10 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
Open Source Consulting | Domain Registration