Bash: Remove unnecessary lines