xref: /aosp_15_r20/external/rappor/bin/decode-dist (revision 2abb31345f6c95944768b5222a9a5ed3fc68cc00)
1*2abb3134SXin Li#!/bin/bash
2*2abb3134SXin Li#
3*2abb3134SXin Li# Decode a distribution from summed RAPPOR reports.
4*2abb3134SXin Li#
5*2abb3134SXin Li# This is a tiny shell wrapper around R.
6*2abb3134SXin Li
7*2abb3134SXin Lireadonly THIS_DIR=$(dirname $0)
8*2abb3134SXin Li
9*2abb3134SXin Li# NOTE: A trailing / is *required* on RAPPOR_REPO, because we use string
10*2abb3134SXin Li# concatenation to form the absolute path.  (file.path() in R doesn't do what
11*2abb3134SXin Li# we want.)
12*2abb3134SXin Li
13*2abb3134SXin Lireadonly RAPPOR_REPO=$THIS_DIR/../
14*2abb3134SXin Li
15*2abb3134SXin Li# RAPPOR_REPO is used by source() statements to find .R files.
16*2abb3134SXin Liexport RAPPOR_REPO
17*2abb3134SXin Li
18*2abb3134SXin Li# Make sure to reuse the same process so it can be killed easily.
19*2abb3134SXin Liexec $THIS_DIR/decode_dist.R "$@"
20