Tags: scripting
Rating: 3.5
```
while true
do
case `file flag.txt` in
*tar*) mv flag.txt flag.tar; tar -xvf flag.tar;;
*XZ*) mv flag.txt flag.xz; xz -d flag.xz; mv flag flag.txt;;
*gz*) mv flag.txt flag.gz; gzip -d flag.gz; mv flag flag.txt;;
*bz*) mv flag.txt flag.bz2; bzip2 -d flag.bz2; mv flag flag.txt;;
*Zip*) mv flag.txt flag.zip; unzip flag.zip;;
*ASCII*) exit 1;;
esac
done
```