Rewrite case conversion scripts
This commit is contained in:
parent
6feacfe8ee
commit
f73cf241cf
6 changed files with 10 additions and 20 deletions
|
|
@ -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+
2
bin/h+
|
|
@ -8,7 +8,7 @@ if [ ! "$symbol" ]; then
|
|||
symbol='#'
|
||||
fi
|
||||
|
||||
line=$(sed 1q | uc+)
|
||||
line=$(sed 1q | upper)
|
||||
|
||||
echo "$symbol$symbol $line"
|
||||
echo "$symbol$symbol -----------------------------------------------------------------------------"
|
||||
|
|
|
|||
8
bin/lc+
8
bin/lc+
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use utf8;
|
||||
use open qw(:std :utf8);
|
||||
|
||||
while (<>) {
|
||||
print lc $_;
|
||||
}
|
||||
3
bin/lower
Executable file
3
bin/lower
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
tr '[:upper:]' '[:lower:]'
|
||||
8
bin/uc+
8
bin/uc+
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use utf8;
|
||||
use open qw(:std :utf8);
|
||||
|
||||
while (<>) {
|
||||
print uc $_;
|
||||
}
|
||||
3
bin/upper
Executable file
3
bin/upper
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
tr '[:lower:]' '[:upper:]'
|
||||
Loading…
Add table
Add a link
Reference in a new issue