mirror of
https://github.com/notwa/rc
synced 2024-11-05 03:19:02 -08:00
15 lines
367 B
Bash
Executable file
15 lines
367 B
Bash
Executable file
#!/usr/bin/env dash
|
|
# YES_ZSH
|
|
# YES_BASH
|
|
# YES_DASH
|
|
|
|
slit() { ### @-
|
|
### view specific columns of text.
|
|
[ $# -gt 0 ] || { printf "%s\n" "$0: too few arguments" >&2; return 1; }
|
|
awk "{ print $(printf ',$%s' $@ | cut -b2-) }"
|
|
|
|
# via: https://github.com/sorin-ionescu/prezto/
|
|
#awk "{ print ${(j:,:):-\$${^@}} }"
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || slit "$@"
|