following Fede's lead I wrote a few more scripts to try to keep the autoconf/configure happy. -Steve Reference: /n/sources/patch/applied/ape-scripts Date: Wed Apr 14 13:26:17 CES 2010 Signed-off-by: steve@quintile.net --- /rc/bin/ape/grep Wed Apr 14 13:22:14 2010 +++ /rc/bin/ape/grep Wed Apr 14 13:22:13 2010 @@ -1,3 +1,22 @@ #!/bin/rc -# the -G flag is gone! -exec /$cputype/bin/grep $* + +rfork e + +opts=() +files=() +argv0=$0 +while(! ~ $#* 0){ + switch($1){ + case -[cefinsv] + opts=($opts $1) + case -q + opts=($opts -s) + case -* + echo $argv0 $1 not supported >[2=1] + exit 'not supported' + case * + files=($files $1) + } + shift +} +exec /$cputype/bin/grep $opts $files --- /rc/bin/ape/cat Thu Jan 1 00:00:00 1970 +++ /rc/bin/ape/cat Wed Apr 14 13:22:16 2010 @@ -0,0 +1,18 @@ +#!/bin/rc + +rfork e + +files=() +while(! ~ $#* 0){ + switch($1){ + case - + files=($files /fd/0) + case -* + ; + case * + files=($files $1) + } + shift +} + +exec /$cputype/bin/cat $files --- /rc/bin/ape/egrep Thu Jan 1 00:00:00 1970 +++ /rc/bin/ape/egrep Wed Apr 14 13:22:17 2010 @@ -0,0 +1,2 @@ +#!/bin/rc +exec /rc/bin/ape/grep $* --- /rc/bin/ape/fgrep Thu Jan 1 00:00:00 1970 +++ /rc/bin/ape/fgrep Wed Apr 14 13:22:18 2010 @@ -0,0 +1,2 @@ +#!/bin/rc +exec /rc/bin/ape/grep $* --- /rc/bin/ape/ln Thu Jan 1 00:00:00 1970 +++ /rc/bin/ape/ln Wed Apr 14 13:22:20 2010 @@ -0,0 +1,23 @@ +#!/bin/rc + +argv0=$0 +force=n +while(! ~ $#* 0 && ~ $1 -*){ + switch($1){ + case -f + force=y + case -s + ; + case * + echo 'usage: ln [-s] [-f] source destination' >[2=1] + exit 'usage' + } + shift +} + +if(~ $force n && test -e $2){ + echo ln: $2 destination exists >[2=1] + exit 'usage' +} + +exec cp -gux $1 $2