Skip to content

Commit

Permalink
map 1-index to 0-index, correct params
Browse files Browse the repository at this point in the history
  • Loading branch information
erikfrey committed Mar 23, 2009
1 parent d4f4730 commit 047e166
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions br
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -116,18 +116,31 @@ then
else else
if [[ -z $input ]] if [[ -z $input ]]
then then
brp $out_files brp - `expr $mapcolumn - 1` $out_files
else else
pv $input | brp $out_files pv $input | brp - `expr $mapcolumn - 1` $out_files
fi fi
fi fi


# save it somewhere # save it somewhere
if [[ -z $output ]] if [[ -z `which brm` ]]
then then
sort -k$mapcolumn,$mapcolumn -m $jobpath/in/* # use sort -m if we don't have brm
# sort -m creates tmp files if too many input files are specified
# brm doesn't do this
if [[ -z $output ]]
then
sort -k$mapcolumn,$mapcolumn -m $jobpath/in/*
else
sort -k$mapcolumn,$mapcolumn -m $jobpath/in/* | pv > $output
fi
else else
sort -k$mapcolumn,$mapcolumn -m $jobpath/in/* | pv > $output if [[ -z $output ]]
then
brm - `expr $mapcolumn - 1` `find $jobpath/in/ -type p | xargs`
else
brm - `expr $mapcolumn - 1` `find $jobpath/in/ -type p | xargs` | pv > $output
fi
fi fi


# finally, clean up after ourselves # finally, clean up after ourselves
Expand Down

0 comments on commit 047e166

Please sign in to comment.