[dev] [sbase] shell scripts

From: Strake <strake888_AT_gmail.com>
Date: Sun, 7 Jul 2013 09:00:35 -0500

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

This archive was generated by hypermail 2.3.0 : Sun Jul 07 2013 - 16:12:06 CEST