Skip to content

Commit

Permalink
Fix inconsistent indentation, make sed -r detection actually work.
Browse files Browse the repository at this point in the history
(Running `sed -r` without any pattern fails even if sed supports -r)
  • Loading branch information
EtiennePerot committed Feb 15, 2014
1 parent 5773d6d commit 7fff20a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parcimonie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ fi

# Test for GNU `sed`, or use a `sed` fallback in sedExtRegexp
sedExec=(sed)
if echo "test the extended regexp flag" | sed -r &> /dev/null; then
if [ "$(echo 'abc' | sed -r 's/abc/def/' || true)" == 'def' ]; then
# GNU Linux sed
sedExec+=(-r)
sedExec+=(-r)
else
# Mac OS (BSD?) sed
# Mac OS X sed
sedExec+=(-E)
fi

Expand Down

0 comments on commit 7fff20a

Please sign in to comment.