1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-13 20:19:03 -08:00
rc/sh/clash

16 lines
447 B
Text
Raw Normal View History

2024-07-01 22:11:33 -07:00
#!/usr/bin/env sh
# compat: +ash +bash +dash +zsh
2024-07-01 22:11:33 -07:00
clash() { ### @- run a command through 12 different shells.
2024-07-01 22:11:33 -07:00
### only returns false when no arguments are given.
[ $# != 0 ] || return
for sh in ash bash dash hush ksh loksh mksh oksh osh posh yash zsh; do
printf >&2 '\033[7m %s \033[m\n' "trying $sh"
2024-07-01 22:11:33 -07:00
"$sh" "$@"
printf >&2 '\033[100m $?=%s \033[m\n' $?
2024-07-01 22:11:33 -07:00
done
true
}
[ -n "${preload+-}" ] || clash "$@"