Данный скрипт убирает все пустоты в текстовом файле, включая пробелы и пустые строки:
#!/bin/bash # Remove blanks in test files echo -n "Emter a file name : " read file out="output.$file" if [ ! -f $file ] then echo "$file not a file!" exit 1 fi sed -e 's/[\t ]//g;/^$/d' $file > $out echo "Output written to $out file"