mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
update clash
with more shells and print exit codes
This commit is contained in:
parent
0f89fa9021
commit
a8beeca8e3
1 changed files with 4 additions and 3 deletions
7
sh/clash
7
sh/clash
|
@ -1,12 +1,13 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
# YES_ZSH YES_BASH YES_DASH YES_ASH
|
# YES_ZSH YES_BASH YES_DASH YES_ASH
|
||||||
|
|
||||||
clash() { ### @- run a command through 9 different shells.
|
clash() { ### @- run a command through 12 different shells.
|
||||||
### only returns false when no arguments are given.
|
### only returns false when no arguments are given.
|
||||||
[ $# != 0 ] || return
|
[ $# != 0 ] || return
|
||||||
for sh in ash bash dash ksh mksh osh posh yash zsh; do
|
for sh in ash bash dash hush ksh loksh mksh oksh osh posh yash zsh; do
|
||||||
printf '\033[7m %s \033[m\n' "trying $sh"
|
printf >&2 '\033[7m %s \033[m\n' "trying $sh"
|
||||||
"$sh" "$@"
|
"$sh" "$@"
|
||||||
|
printf >&2 '\033[100m $?=%s \033[m\n' $?
|
||||||
done
|
done
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue