1 2 3 4 5 6 7
#!/bin/sh # Remove empty lines and all the comments starting with "#" for file in "${@}"; do sed -i "s/\s*#.*//g; /^$/ d" "${file}" done