diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 06:10:09 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 06:10:09 +0300 |
commit | 9b39d1199872a8b12fa4ddf3bfeeb2cc6d961af6 (patch) | |
tree | 0060ef4c16851ac018522f5d25e5b5096b9bf5e9 /setenv.sh | |
parent | tweak licensing notes (diff) | |
download | chess-games-9b39d1199872a8b12fa4ddf3bfeeb2cc6d961af6.tar.gz chess-games-9b39d1199872a8b12fa4ddf3bfeeb2cc6d961af6.zip |
setenv.sh: bugfix
* Add missing '--'s.
Diffstat (limited to '')
-rw-r--r-- | setenv.sh | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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 ) |