plan9fox/sys/src/9/port/mkfilelist
2011-03-31 09:06:36 +00:00

16 lines
266 B
Bash
Executable file

#!/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 ''