(Install ghostscript and screen depends on your distro here for debian/ubuntu)
apt install -y screen ghostscript
Firstly change the path where your files are by changning the line
files='/home/poli/test
Then you can simply do a chmod +x
on both files (they need to be in the same directory) and run
./pdfCompress.sh
To download both scripts run
wget https://gist.githubusercontent.com/IIPoliII/dfe302965ef780caec7bf94ef0eac887/raw/6c401c3b95165c4a6e4332e227eb70f63aa00f98/GSCompress.sh && wget https://gist.githubusercontent.com/IIPoliII/dfe302965ef780caec7bf94ef0eac887/raw/6c401c3b95165c4a6e4332e227eb70f63aa00f98/pdfCompress.sh
or simply download both files manually