Commit 0cb4f905 authored by Vincent Pelletier's avatar Vincent Pelletier

parallel_parse: More quoting.

parent 054a836a
...@@ -22,16 +22,16 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then ...@@ -22,16 +22,16 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0 exit 0
fi fi
PARALLELISM=$1 PARALLELISM="$1"
shift shift
STATE_DIR=$1 STATE_DIR="$1"
mkdir -p "$STATE_DIR" || exit $? mkdir -p "$STATE_DIR" || exit $?
shift shift
OUT_FILE=$1 OUT_FILE="$1"
shift shift
# XXX: any simpler way ? # XXX: any simpler way ?
xargs -0 -r -n 1 -P $PARALLELISM -I "@FILE@" -- "$SHELL" -c 'INFILE="$1";shift;STATE_DIR="$1";shift;echo -n .;"$@" -Q --format json --out "$STATE_DIR/$(sed s:/:@:g <<< "$INFILE").json" "$INFILE"' "$0" "@FILE@" "$STATE_DIR" "$@" xargs -0 -r -n 1 -P "$PARALLELISM" -I "@FILE@" -- "$SHELL" -c 'INFILE="$1";shift;STATE_DIR="$1";shift;echo -n .;"$@" -Q --format json --out "$STATE_DIR/$(sed s:/:@:g <<< "$INFILE").json" "$INFILE"' "$0" "@FILE@" "$STATE_DIR" "$@"
echo echo
# XXX: what if there are too many state files for a single execution ? # XXX: what if there are too many state files for a single execution ?
find "$STATE_DIR" -type f -print0 | xargs -0 -r "$@" --out "$OUT_FILE" --state-file find "$STATE_DIR" -type f -print0 | xargs -0 -r "$@" --out "$OUT_FILE" --state-file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment