mirror of
https://github.com/notwa/rc
synced 2024-06-26 09:07:12 -07:00
Compare commits
No commits in common. "d7089c2ff4c746d29edca6aab87cc80e72dc5c67" and "a9f8dd642cfe5117e64f02748ee84d682f267035" have entirely different histories.
d7089c2ff4
...
a9f8dd642c
|
@ -645,11 +645,6 @@ as a simple example, `echo hey | shcom` produces, verbatim:
|
||||||
hey
|
hey
|
||||||
```
|
```
|
||||||
|
|
||||||
### [shelly](/sh/shelly#L2)
|
|
||||||
|
|
||||||
(perl 5) invoke the first shell found from a list of shells
|
|
||||||
as an interactive, non-login shell. arguments are ignored.
|
|
||||||
|
|
||||||
### [similar](/sh/similar#L8)
|
### [similar](/sh/similar#L8)
|
||||||
|
|
||||||
highlight adjacent lines up to the first inequivalent character.
|
highlight adjacent lines up to the first inequivalent character.
|
||||||
|
@ -1177,7 +1172,6 @@ print each argument on its own line.
|
||||||
| [scramble](#scramble) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [scramble](#scramble) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
| [scropt](#scropt) | bash | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [scropt](#scropt) | bash | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
| [shcom](#shcom) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [shcom](#shcom) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
| [shelly](#shelly) | **perl** | *n/a* | *n/a* | *n/a* | *n/a* |
|
|
||||||
| [similar](#similar) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [similar](#similar) | *sh* | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
| [slit](#slit) | dash | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [slit](#slit) | dash | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
| [slitt](#slitt) | dash | ✔️ | ✔️ | ✔️ | ✔️ |
|
| [slitt](#slitt) | dash | ✔️ | ✔️ | ✔️ | ✔️ |
|
||||||
|
|
0
sh/colors2
Executable file → Normal file
0
sh/colors2
Executable file → Normal file
23
sh/shelly
23
sh/shelly
|
@ -1,23 +0,0 @@
|
||||||
#!/usr/bin/env perl
|
|
||||||
### @ shelly
|
|
||||||
### (perl 5) invoke the first shell found from a list of shells
|
|
||||||
### as an interactive, non-login shell. arguments are ignored.
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use Env qw(@PATH);
|
|
||||||
use File::Spec;
|
|
||||||
|
|
||||||
# arbitrary ordering, feel free to change:
|
|
||||||
my @shells = <zsh osh fish ion bash ash busybox ksh tcsh csh rc dash>;
|
|
||||||
|
|
||||||
for my $s (@shells) {
|
|
||||||
for my $p (@PATH) {
|
|
||||||
my $fp = File::Spec->join($p, $s);
|
|
||||||
my @argv = $s eq "busybox" ? ("sh", "-i") : ($s, "-i");
|
|
||||||
exec {$fp} @argv if -f $fp and -e "$fp";
|
|
||||||
#print STDERR "fail: $fp\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print STDERR "$0: gave up; invoking `sh` without arguments...\n";
|
|
||||||
exec {"sh"} "sh";
|
|
13
tableize
13
tableize
|
@ -55,7 +55,6 @@ tableize() {
|
||||||
'!/usr/bin/env bash') pref=bash;;
|
'!/usr/bin/env bash') pref=bash;;
|
||||||
'!/usr/bin/env dash') pref=dash;;
|
'!/usr/bin/env dash') pref=dash;;
|
||||||
'!/usr/bin/env false') pref=false;;
|
'!/usr/bin/env false') pref=false;;
|
||||||
'!/usr/bin/env perl') pref=perl;;
|
|
||||||
'!/usr/bin/env sh') pref=sh;;
|
'!/usr/bin/env sh') pref=sh;;
|
||||||
'!/usr/bin/env zsh') pref=zsh;;
|
'!/usr/bin/env zsh') pref=zsh;;
|
||||||
'!/usr/bin/sh') pref=sh;;
|
'!/usr/bin/sh') pref=sh;;
|
||||||
|
@ -73,22 +72,16 @@ tableize() {
|
||||||
local yay='✔️' # yay='y'
|
local yay='✔️' # yay='y'
|
||||||
local nay='⭕' # nay='✖️' # nay='n'
|
local nay='⭕' # nay='✖️' # nay='n'
|
||||||
local huh='❔' # huh='?'
|
local huh='❔' # huh='?'
|
||||||
local etc='*n/a*'
|
|
||||||
|
|
||||||
# TODO: escape underscores in filenames.
|
# TODO: escape underscores in filenames.
|
||||||
printf '| [%s](#%s) ' "$fn" "$fn"
|
printf '| [%s](#%s) ' "$fn" "$fn"
|
||||||
printf "%$(( 40 - 2 * ${#fn} ))s" '' # funky way to pad the rest of the column
|
printf "%$(( 40 - 2 * ${#fn} ))s" '' # funky way to pad the rest of the column
|
||||||
|
[ "$pref" != false ] || pref='**false**'
|
||||||
local p="$pref"
|
[ "$pref" != sh ] || pref='*sh*'
|
||||||
[ "$pref" != false ] || p='**false**'
|
[ -n "$pref" ] && printf '| %10s ' "$pref" || printf '| %9s%s ' '' "$huh"
|
||||||
[ "$pref" != perl ] || p='**perl**'
|
|
||||||
[ "$pref" != sh ] || p='*sh*'
|
|
||||||
[ -n "$p" ] && printf '| %10s ' "$p" || printf '| %9s%s ' '' "$huh"
|
|
||||||
|
|
||||||
local t=
|
local t=
|
||||||
for t in "$zsh" "$bash" "$dash" "$ash"; do
|
for t in "$zsh" "$bash" "$dash" "$ash"; do
|
||||||
local w="$huh"
|
local w="$huh"
|
||||||
[ "$pref" != perl ] || w="$etc"
|
|
||||||
[ "$t" != yes ] || w="$yay"
|
[ "$t" != yes ] || w="$yay"
|
||||||
[ "$t" != no ] || w="$nay"
|
[ "$t" != no ] || w="$nay"
|
||||||
# can't use '%4s' here because printf gets confused by UTF-8.
|
# can't use '%4s' here because printf gets confused by UTF-8.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user