I see some utilities in sbase what could easily be shorter as
shell/awk scripts. Some utilities I sent in earlier, e.g. cut, were
turned down for this reason.
For examples, head:
#!/bin/sh
n=10;
while getopts 'n:' o; do
case $o in
(n) n="$OPTARG";;
esac
done
shift $(dc -e "$OPTIND 1 - p");
for x in "$_AT_"; do sed ${n}q <"$x"; done
# END
pwd:
#!/bin/sh
echo "$PWD"
#END
Why are these in C?
head.sh now needs dc, but could easily rather use intc [1], which we
could include in sbase.
[1]
https://github.com/strake/intc
Received on Sun Jul 07 2013 - 16:00:35 CEST