aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.bashrc
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-21 14:57:50 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-21 14:57:50 +0300
commit932a32fec88f086bdbc179a02966e358523294f4 (patch)
tree019566465fbded8bd9497b80c9953b810b4457da /.bashrc
parentspawn_ssh_agent: bugfix (diff)
downloadlinux-home-932a32fec88f086bdbc179a02966e358523294f4.tar.gz
linux-home-932a32fec88f086bdbc179a02966e358523294f4.zip
add slice_pgn_moves, normalize_pgn
Diffstat (limited to '')
-rw-r--r--.bashrc11
1 files changed, 10 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index e986c91..c92e51b 100644
--- a/.bashrc
+++ b/.bashrc
@@ -347,4 +347,13 @@ runcxx() (
PYTHONSTARTUP="$HOME/.pythonrc"
-alias strip_pgn_clk='sed --binary --in-place '"'"'s/ {\[%clk [[:digit:]]:[[:digit:]]\{2\}:[[:digit:]]\{2\}\]}//g'"'"
+alias strip_pgn_clk='sed --binary --in-place '"'"'s/ {\[%clk [[:digit:]]\+:[[:digit:]]\+\(:[[:digit:]]\+\)*\]}//g'"'"
+alias slice_pgn_moves='sed --binary --in-place '"'"'s/ \([[:digit:]]\+\.\)/\n\1/g'"'"
+
+normalize_pgn() {
+ dos2eol "$@" \
+ && lint "$@" \
+ && strip_pgn_clk "$@" \
+ && slice_pgn_moves "$@" \
+ && eol2dos "$@"
+}