Rewrite case conversion scripts

This commit is contained in:
Ev Bogdanov 2017-08-16 19:14:53 +03:00
parent 6feacfe8ee
commit f73cf241cf
6 changed files with 10 additions and 20 deletions

View file

@ -88,14 +88,14 @@ Who is who in **bin** directory:
- `git+ MESSAGE` git: commit and push to master
- `h+ SYMBOL` draw a pretty heading
- `hg+ MESSAGE` hg: commit and push to master
- `lc+` to lowercase
- `lower` convert selection to lowercase
- `nobs+` taken from plan9 `nobs` (it removes all backspace characters and the characters that precede them)
- `s-` remove leading whitespace
- `s2t N_SPACES` spaces to tabs (default: 4 spaces to 1 tab)
- `t2s N_SPACES` tabs to spaces (default: 1 tab to 4 spaces)
- `t+` add tab
- `t-` delete tab
- `uc+` to uppercase
- `upper` convert selection to uppercase
Put these guys in your **$PATH**.
@ -145,7 +145,7 @@ Put these guys in your **$PATH**.
- `Edit , > wc -l` count lines in file
- `Edit , | sort` sort lines
- `Edit 3,5p` print lines 3..5 in new window
- `Edit 3,5 |uc+` lines 3..5 upper cased
- `Edit 3,5 |upper` lines 3..5 upper cased
- `Edit 3,5 s/HE/he/g` replace on 3..5 lines only
- `Edit 2 d` delete second line
- `Edit 2 a/new\n/` append text after 2nd line

2
bin/h+
View file

@ -8,7 +8,7 @@ if [ ! "$symbol" ]; then
symbol='#'
fi
line=$(sed 1q | uc+)
line=$(sed 1q | upper)
echo "$symbol$symbol $line"
echo "$symbol$symbol -----------------------------------------------------------------------------"

View file

@ -1,8 +0,0 @@
#!/usr/bin/env perl
use utf8;
use open qw(:std :utf8);
while (<>) {
print lc $_;
}

3
bin/lower Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
tr '[:upper:]' '[:lower:]'

View file

@ -1,8 +0,0 @@
#!/usr/bin/env perl
use utf8;
use open qw(:std :utf8);
while (<>) {
print uc $_;
}

3
bin/upper Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
tr '[:lower:]' '[:upper:]'