From 9b39d1199872a8b12fa4ddf3bfeeb2cc6d961af6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 7 Nov 2016 06:10:09 +0300 Subject: setenv.sh: bugfix * Add missing '--'s. --- setenv.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'setenv.sh') diff --git a/setenv.sh b/setenv.sh index a6034a5..115e015 100644 --- a/setenv.sh +++ b/setenv.sh @@ -62,17 +62,17 @@ # * gets a single newline (\r\n) appended at the end of the file. lint_pgn() { - sed --binary --in-place 's/\r\?$/\r/' "$@" \ - && sed --binary --in-place 's/[[:blank:]]*\(\r\?\)$/\1/' "$@" \ - && sed --binary --in-place -e :a -e '/^\(\r\n\)*\r$/{$d;N;ba}' "$@" \ - && sed --binary --in-place '$s/\r\?$/\r/;a\' "$@" + sed --binary --in-place -- 's/\r\?$/\r/' "$@" \ + && sed --binary --in-place -- 's/[[:blank:]]*\(\r\?\)$/\1/' "$@" \ + && sed --binary --in-place -e :a -e '/^\(\r\n\)*\r$/{$d;N;ba}' -- "$@" \ + && sed --binary --in-place -- '$s/\r\?$/\r/;a\' "$@" } # Strips [%clk] tags from PGN files. -alias strip_pgn_clk='sed --binary --in-place '"'"'s/ {\[%clk [[:digit:]]\+:[[:digit:]]\+\(:[[:digit:]]\+\)*\]}//g'"'" +alias strip_pgn_clk='sed --binary --in-place -- '"'"'s/ {\[%clk [[:digit:]]\+:[[:digit:]]\+\(:[[:digit:]]\+\)*\]}//g'"'" # Places main line moves at separate lines. -alias slice_pgn_moves='sed --binary --in-place '"'"'s/ \([[:digit:]]\+\.\)/\r\n\1/g'"'" +alias slice_pgn_moves='sed --binary --in-place -- '"'"'s/ \([[:digit:]]\+\.\)/\r\n\1/g'"'" # "Prettifies" PGN files by (see above) # @@ -91,8 +91,8 @@ append_pgn() { return 1 fi - printf '\r\n' >> "$1" \ - && cat "$2" >> "$1" + printf -- '\r\n' >> "$1" \ + && cat -- "$2" >> "$1" } join_pgns() ( @@ -103,11 +103,11 @@ join_pgns() ( set -o errexit - cat "$1" + cat -- "$1" local i for i in "${@:2}"; do - printf '\r\n' + printf -- '\r\n' cat "$i" done ) -- cgit v1.2.3