coduno / toolbox

Compute Engine Environment for Coduno
Apache License 2.0
0 stars 0 forks source link

Make curl write newline #4

Closed lorenzleutgeb closed 9 years ago

lorenzleutgeb commented 9 years ago

This is a variation of e0c04f025c

What did the sed command actually do?

curl will now always append a newline. In case sed was more sophisticated about when to append the newline, this could break something.

WanzenBug commented 9 years ago

From my understanding this should have the exact same behaviour as the sed version.

Unintended side effects may arise should Github ever decide to include a newline of their own. I'm not sure on the behaviour of read on an empty line but I think it will be skipped.

lorenzleutgeb commented 9 years ago

From my understanding this should have the exact same behaviour as the sed version.

What's the sed expression saying anyway?

I'm not sure on the behaviour of read on an empty line but I think it will be skipped.

I got

""
""

from

#!/bin/bash
echo -e "\n" | while read line
do
        echo -e "\"$line\""
done

which indicates that empty lines are not skipped.

Guarding with [ "" != "$line" ] will work, though.