OS X compatible line-ending stripping

BSD sed interprets sed 's/\r//' as "replace the literal letter r". A more compatible approach delegates the interpretation of this sequence to bash.

Fixes #186
This commit is contained in:
Tim Harper 2017-09-26 15:30:03 -06:00 committed by GitHub
parent c0b961c5c3
commit d251388f53
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ process_my_args () {
loadConfigFile() {
# Make sure the last line is read even if it doesn't have a terminating \n
cat "$1" | sed '/^\#/d;s/\r$//' | while read -r line || [[ -n "$line" ]]; do
cat "$1" | sed $'/^\#/d;s/\r$//' | while read -r line || [[ -n "$line" ]]; do
eval echo $line
done
}