The shell script for conversion of “lowercase letters” for AvP


#1

Hi

I remember that in the Linux version of AvP created by Daniel Langnas was a file extract.sh:

https://www.assembla.com/code/avp_mod/git/nodes/master/extract.sh

I think that one of the functions of this script was a conversion of all files and directories to be lowercase. Do you plan to add a similar script to a tar archive with AvP game?


#2

The original readme recommended http://www.primaledge.ca/chcase.html

Looks like this command would do the trick (make backups, just in case!):
chcase -rd


#3

It works. Thanks.

Do you plan to integrate this shell script with you version of AvP?
That will be nice if the installation process will be simple for everyone.

$ chcase -rd ‘/home/gbudny/Downloads/app’
/home/gbudny/Downloads/app/
|__AvP_Classic.exe => avp_classic.exe
|__README.txt => readme.txt
|__fastfile/
|__Snd44.FFL => snd44.ffl
|__Tex20.FFL => tex20.ffl
|__Snd26.FFL => snd26.ffl
|__Snd45.FFL => snd45.ffl
|__Tex41.FFL => tex41.ffl
|__Tex12.FFL => tex12.ffl
|__Tex46.FFL => tex46.ffl
|__Tex11.FFL => tex11.ffl
|__Snd41.FFL => snd41.ffl
|__Snd10.FFL => snd10.ffl
|__Snd34.FFL => snd34.ffl
|__Snd9.FFL => snd9.ffl
|__Tex33.FFL => tex33.ffl
|__Tex56.FFL => tex56.ffl
|__Snd38.FFL => snd38.ffl
|__Tex49.FFL => tex49.ffl
|__Tex14.FFL => tex14.ffl
|__Tex25.FFL => tex25.ffl
|__Tex48.FFL => tex48.ffl
|__Snd24.FFL => snd24.ffl
|__Tex53.FFL => tex53.ffl
|__Snd49.FFL => snd49.ffl
|__Snd35.FFL => snd35.ffl
|__Tex22.FFL => tex22.ffl
|__Tex1.FFL => tex1.ffl
|__Tex43.FFL => tex43.ffl
|__Tex57.FFL => tex57.ffl
|__Tex32.FFL => tex32.ffl
|__Tex7.FFL => tex7.ffl
|__Snd12.FFL => snd12.ffl
|__Snd46.FFL => snd46.ffl
|__Snd48.FFL => snd48.ffl
|__Tex36.FFL => tex36.ffl
|__Snd20.FFL => snd20.ffl
|__Tex39.FFL => tex39.ffl
|__Tex42.FFL => tex42.ffl
|__Tex2.FFL => tex2.ffl
|__Snd47.FFL => snd47.ffl
|__Tex4.FFL => tex4.ffl
|__Snd50.FFL => snd50.ffl
|__Tex54.FFL => tex54.ffl
|__Tex10.FFL => tex10.ffl
|__Snd17.FFL => snd17.ffl
|__Snd29.FFL => snd29.ffl
|__Tex38.FFL => tex38.ffl
|__Tex27.FFL => tex27.ffl
|__Tex28.FFL => tex28.ffl
|__Snd21.FFL => snd21.ffl
|__Snd23.FFL => snd23.ffl
|__Tex24.FFL => tex24.ffl
|__PredSound.dat => predsound.dat
|__Tex31.FFL => tex31.ffl
|__Tex19.FFL => tex19.ffl
|__Snd16.FFL => snd16.ffl
|__Tex21.FFL => tex21.ffl
|__Tex40.FFL => tex40.ffl
|__Tex9.FFL => tex9.ffl
|__Tex26.FFL => tex26.ffl
|__Snd37.FFL => snd37.ffl
|__Tex37.FFL => tex37.ffl
|__Tex23.FFL => tex23.ffl
|__Tex8.FFL => tex8.ffl
|__Tex17.FFL => tex17.ffl
|__Snd31.FFL => snd31.ffl
|__QueenSound.dat => queensound.dat
|__Tex13.FFL => tex13.ffl
|__Snd11.FFL => snd11.ffl
|__Tex29.FFL => tex29.ffl
|__Snd33.FFL => snd33.ffl
|__Snd30.FFL => snd30.ffl
|__Snd28.FFL => snd28.ffl
|__Tex58.FFL => tex58.ffl
|__Tex18.FFL => tex18.ffl
|__Tex15.FFL => tex15.ffl
|__Tex34.FFL => tex34.ffl
|__AlienSound.dat => aliensound.dat
|__Snd19.FFL => snd19.ffl
|__Tex51.FFL => tex51.ffl
|__Snd15.FFL => snd15.ffl
|__Tex45.FFL => tex45.ffl
|__Tex50.FFL => tex50.ffl
|__Snd8.FFL => snd8.ffl
|__Snd14.FFL => snd14.ffl
|__Snd25.FFL => snd25.ffl
|__Snd40.FFL => snd40.ffl
|__Tex52.FFL => tex52.ffl
|__Snd27.FFL => snd27.ffl
|__Snd32.FFL => snd32.ffl
|__Tex35.FFL => tex35.ffl
|__Snd39.FFL => snd39.ffl
|__Snd18.FFL => snd18.ffl
|__Tex6.FFL => tex6.ffl
|__Snd36.FFL => snd36.ffl
|__Snd43.FFL => snd43.ffl
|__Tex44.FFL => tex44.ffl
|__Snd51.FFL => snd51.ffl
|__Tex16.FFL => tex16.ffl
|__Tex30.FFL => tex30.ffl
|__Tex5.FFL => tex5.ffl
|__Snd6.FFL => snd6.ffl
|__Snd42.FFL => snd42.ffl
|__Snd4.FFL => snd4.ffl
|__Snd2.FFL => snd2.ffl
|__Snd5.FFL => snd5.ffl
|__Snd22.FFL => snd22.ffl
|__Tex47.FFL => tex47.ffl
|__Snd7.FFL => snd7.ffl
|__Tex55.FFL => tex55.ffl
|__Snd13.FFL => snd13.ffl
|__Snd3.FFL => snd3.ffl
|__Tex3.FFL => tex3.ffl
|__Galaxy.dll => galaxy.dll
|__SMACKW32.DLL => smackw32.dll
|____support/
|__add/
|__avp_huds/
|__Tongue.RIF => tongue.rif
|__alien_hud.RIF => alien_hud.rif
|__pred ship fury.RIF => pred ship fury.rif
|__DROPSHIP.RIF => dropship.rif
|__hnpcpred_alien.RIF => hnpcpred_alien.rif
|__hnpc_xenoborg.RIF => hnpc_xenoborg.rif
|__Disk.RIF => disk.rif
|__hnpc_civvie.RIF => hnpc_civvie.rif
|__queen.RIF => queen.rif
|__hnpcmarine.RIF => hnpcmarine.rif
|__pred_hud.RIF => pred_hud.rif
|__Mdisk.RIF => mdisk.rif
|__sentry.RIF => sentry.rif
|__CREDITS.txt => credits.txt
|__avp_rifs/
|__SUBWAY.rif => subway.rif
|__hive_c.RIF => hive_c.rif
|__Derelict_A.RIF => derelict_a.rif
|__E3demoSP.rif => e3demosp.rif
|__Furyall.RIF => furyall.rif
|__Jockey.RIF => jockey.rif
|__hive.RIF => hive.rif
|__Als-dm.RIF => als-dm.rif
|__Area52.RIF => area52.rif
|__Nost03.RIF => nost03.rif
|__Stat101_M.rif => stat101_m.rif
|__Invasion_P.RIF => invasion_p.rif
|__Hangar.RIF => hangar.rif
|__kens-co-op.RIF => kens-co-op.rif
|__Temple_M.RIF => temple_m.rif
|__Nost03_M.rif => nost03_m.rif
|__Statue.RIF => statue.rif
|__Fall.RIF => fall.rif
|__Invasion.RIF => invasion.rif
|__Leadworks_coop.rif => leadworks_coop.rif
|__Sulaco_a.RIF => sulaco_a.rif
|__Sulaco.RIF => sulaco.rif
|__Base.RIF => base.rif
|__Temple_p.RIF => temple_p.rif
|__Caverns_A.RIF => caverns_a.rif
|__Compoundcoop.RIF => compoundcoop.rif
|__Lab14coop.rif => lab14coop.rif
|__Invasion_A.RIF => invasion_a.rif
|__Lockdown4.rif => lockdown4.rif
|__Leadworks.rif => leadworks.rif
|__Trapped.RIF => trapped.rif
|__Breakout_P.rif => breakout_p.rif
|__SUBWAYcoop.rif => subwaycoop.rif
|__Compound.RIF => compound.rif
|__Fall_m.RIF => fall_m.rif
|__Vaults.RIF => vaults.rif
|__Breakout.RIF => breakout.rif
|__Caverns.RIF => caverns.rif
|__Stat101.RIF => stat101.rif
|__Lab14.rif => lab14.rif
|__Escape.RIF => escape.rif
|__Genshd1.RIF => genshd1.rif
|__Derelict.RIF => derelict.rif
|__Temple.RIF => temple.rif
|__E3demo.RIF => e3demo.rif
|__Vaults_M.RIF => vaults_m.rif
|__Sulaco_p.RIF => sulaco_p.rif
|__jockeycoop.RIF => jockeycoop.rif
|__Battle.RIF => battle.rif
|__CD Tracks.txt => cd tracks.txt
|__FMVs => fmvs
|__fmvs/
|__08 Vaults.bik => 08 vaults.bik
|__10 Caverns.bik => 10 caverns.bik
|__AlienOutro.bik => alienoutro.bik
|__04 Orbital.bik => 04 orbital.bik
|__06 Waterfall.bik => 06 waterfall.bik
|__03 Invasion.bik => 03 invasion.bik
|__13 Gateway.bik => 13 gateway.bik
|__05 Tyrargo.bik => 05 tyrargo.bik
|__14 Escape.bik => 14 escape.bik
|__Menubackground.bik => menubackground.bik
|__PredatorOutro.bik => predatoroutro.bik
|__12 Temple.bik => 12 temple.bik
|__MarineIntro.bik => marineintro.bik
|__01 Marine Music 1.bik => 01 marine music 1.bik
|__Message154.smk => message154.smk
|__Message158.smk => message158.smk
|__PredatorIntro.bik => predatorintro.bik
|__IntroSound.smk => introsound.smk
|__AlienIntro.bik => alienintro.bik
|__11 Ferarco.bik => 11 ferarco.bik
|__02 Colony.bik => 02 colony.bik
|__15 Earthbound.bik => 15 earthbound.bik
|__MarineOutro.bik => marineoutro.bik
|__09 Fury 161.bik => 09 fury 161.bik
|__07 Area 52.bik => 07 area 52.bik


#4

Put the following line in a terminal open in the directory full of files you want lowercase, and it does the same thing (tr is a nifty program!):

for i in * ; do mv -n “$i” “$(echo “$i” | tr [:upper:] [:lower:])” ; done


#5

Thanks.

Unfortunately, this command works only with files placed in the current directory, and chase can be used with current directory and files located in subdirectories.


#6

Try this then, in the AvP directory. It may have more commands, but it’s shorter overall:

find . -type f | while read i ; do mv -n “$i” “$(echo “$i” | rev | cut -f1 -d/ --complement | rev )/$(echo “$i” | rev | cut -f1 -d/ | rev | tr [:upper:] [:lower:])” ; done


#7

I will try it.

I think that will be cool if after the compilation process I will see the question about the directory with the game. In this case, I can just type name of the directory. Later, the shell script will use this command or chase, and then copy the binary file AvP to the directory with the game.