code: 9ferno

ref: e81c54ba2ecc673a4d5f8aed0e9b52841fe07b0d
dir: /os/port/mkfilelist/

View raw version
#!/bin/rc

rfork e
switch($#*){
case 1
	RE=`{echo *.c | sed 's/ /|/g; s/.*/^(&)$/'}
	if(~ $RE '^(*.c)$')
		LIST=`{builtin cd $1; ls *.c }
	if not
		LIST=`{builtin cd $1; ls *.c | grep -v ''$RE''}
	echo $LIST | sed 's/\.c//g; s/ +/|/g'
case *
	exit 'usage'
}
exit ''