On 11/09/2012 09:50 AM, Bernhard Voelker wrote:
On 11/09/2012 10:13 AM, Paul Eggert wrote:* tests/df/df-output.sh: For the test "df -B1K --output=size", do not assume that the file system size fits in 9 bytes; it might be larger than that, so omit leading space. Also, use portable 'sed' commands: POSIX says sed commands inside { } should all end in newline.Good catch, thanks. My file system for '.' is too small for this test to fail ... ;-)
Yes thanks for the fix Paul.
-sed -e '1 {s/ [ ]*/ /g;q}' out > out2 +sed -e '1 { + s/ [ ]*/ /g + s/^ // + q + }' out > out2What about simplifying the first s/... to eliminate all blanks? -sed -e '1 {s/ [ ]*/ /g;q}' out > out2 +sed -e '1 { + s/ //g + q + }' out > out2
I suppose you could simplify them all to a single line again by using coreutils head, tail and tr instead of sed? replace sed 1 ... with: head -n1 | tr -s ' ' and sed 3... with: tail -n1 | tr -s ' ' and the right aligned df -B1K one with: head -n1 | tr -d ' ' cheers, Pádraig.
