85bfb0e9eb
The new rc's exit status will be '' for a successfull pipeline execution instead of '|'. This is a bit too tightly coupled, so just use if() statement instead, handling this in a portable way.
13 lines
275 B
Plaintext
13 lines
275 B
Plaintext
O=$1
|
|
shift
|
|
objtype=$1
|
|
shift
|
|
if(ls -p ../$objtype/*.[cs] >[2]/dev/null | sed 's/..$//;s/^/^/' > /tmp/reduce.$pid) {
|
|
echo $* | tr ' ' \012 | grep -v -f /tmp/reduce.$pid | tr \012 ' '
|
|
}
|
|
if not {
|
|
# if empty directory, just return the input files
|
|
echo $*
|
|
}
|
|
rm /tmp/reduce.$pid
|