Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hosts preference in ~/.br.hosts #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.textile
Expand Up @@ -8,7 +8,7 @@ bashreduce lets you apply your favorite unix tools in a mapreduce fashion across

h2. Configuration

Edit @/etc/br.hosts@ and enter the machines you wish to use as workers. Or specify your machines at runtime:
Edit @~/.br.hosts@ and/or @/etc/br.hosts@ and enter the machines you wish to use as workers. Or specify your machines at runtime:

<pre>br -m "host1 host2 host3"</pre>

Expand Down
8 changes: 5 additions & 3 deletions br
Expand Up @@ -13,7 +13,7 @@ showhelp() {
echo "Usage: `basename $1`: [-m host1 [host2...]] [-c column] [-r reduce] [-i input] [-o output]"
echo "bashreduce. Map an input file to many hosts, sort/reduce, merge"
echo " -m: hosts to use, can repeat hosts for multiple cores"
echo " default hosts from /etc/br.hosts"
echo " default hosts from ~/.br.hosts or /etc/br.hosts"
echo " -c: column to partition, default = 1 (1-based)"
echo " -r: reduce function, default = identity"
echo " -i: input file, default = stdin"
Expand Down Expand Up @@ -47,10 +47,12 @@ while getopts "m:c:r:i:o:t:S:h" name; do
done

if [ -z $hosts ]; then
if [ -e /etc/br.hosts ]; then
if [ -e $HOME/.br.hosts ]; then
hosts=`cat $HOME/.br.hosts`
else if [ -e /etc/br.hosts ]; then
hosts=`cat /etc/br.hosts`
else
echo "`basename $0`: must specify hosts with -m or provide /etc/br.hosts"
echo "`basename $0`: must specify hosts with -m or provide ~/.br.hosts or /etc/br.hosts"
usage $0
fi
fi
Expand Down