#!/bin/bash pid=$(ps a | grep -i "tesi.pdf" | grep -v grep | cut -d" " -f 1) make if [[ ! -z $pid ]]; then kill $pid fi mupdf tesi.pdf &