From f05d745f30dea9810c42b75c5f191e57a68fa74a Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 6 Oct 2016 20:45:23 +0300 Subject: mustn't be a repository anymore --- .bash_utils/text.sh | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .bash_utils/text.sh (limited to '.bash_utils/text.sh') diff --git a/.bash_utils/text.sh b/.bash_utils/text.sh deleted file mode 100644 index ad3f203..0000000 --- a/.bash_utils/text.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2016 Egor Tensin -# This file is part of the "Cygwin configuration files" project. -# For details, see https://github.com/egor-tensin/cygwin-home. -# Distributed under the MIT License. - -alias dos2eol='sed --binary --in-place '"'"'s/\(\r\?\)$//'"'" -alias eol2dos='sed --binary --in-place '"'"'s/\r\?$/\r/'"'" - -alias trim='sed --binary --in-place '"'"'s/[[:blank:]]*\(\r\?\)$/\1/'"'" - -alias trimeol='sed --binary --in-place -e :a -e '"'"'/^\n*$/{$d;N;ba}'"'" -alias trimdoseol='sed --binary --in-place -e :a -e '"'"'/^\(\r\n\)*\r$/{$d;N;ba}'"'" - -alias eol='sed --binary --in-place '"'"'$a\'"'" -alias doseol='sed --binary --in-place '"'"'$s/\r\?$/\r/;a\'"'" - -alias trimbom='sed --binary --in-place '"'"'1 s/^\xef\xbb\xbf//'"'" - -lint() { - trim "$@" && trimeol "$@" && eol "$@" -} - -doslint() { - trim "$@" && trimdoseol "$@" && doseol "$@" -} - -replace_word() ( - set -o errexit -o nounset -o pipefail - - if [ "$#" -lt 3 ]; then - echo "usage: ${FUNCNAME[0]} OLD NEW PATH..." >&2 - return 1 - fi - - local old="$1" - shift - local new="$2" - shift - - sed --binary --in-place "s/\\b$old\\b/$new/g" "$@" -) -- cgit v1.2.3