bash zen

Today I needed to reverse-engineer a file that could serve as input to the TLJ sound conversion scripts. Who needs ython, when you can do it in bash?

find . -name "*.xarc" | while read ; do DIR=`dirname $REPLY` ; arcx -l $REPLY | grep \.isn | while read ; do FILE=`echo $REPLY | sed -e 's/\.isn.*//'` ; echo levels/$DIR/$FILE.wav ; echo -n $DIR/ ; echo $FILE ; done | sed -e 's/\//\\/g' -e 's/^\.\\/c:\\export\\/' -e 's/\.\\//' ; done > ../../sound/mapping.txt

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s