Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apachedex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
apachedex
Commits
0ae2ae8d
Commit
0ae2ae8d
authored
Apr 09, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline helper to simplify usage.
parent
98141ebe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
parallel_parse.sh
parallel_parse.sh
+4
-9
parallel_parse_helper.sh
parallel_parse_helper.sh
+0
-7
No files found.
parallel_parse.sh
View file @
0ae2ae8d
#!/bin/sh
#!/bin/
ba
sh
usage
()
{
usage
()
{
echo
"Usage:"
echo
"Usage:"
echo
" find [...] -print0 |
$0
\\
"
echo
" find [...] -print0 |
$0
\\
"
echo
" pa
th_to_helper pa
rallelism state_dir out_file command [arg1 [...]]"
echo
" parallelism state_dir out_file command [arg1 [...]]"
echo
"Reads filenames to process from stdin, null-delimited."
echo
"Reads filenames to process from stdin, null-delimited."
}
}
...
@@ -11,12 +11,6 @@ if [ $1 = '-h' -o $1 = '--help' ]; then
...
@@ -11,12 +11,6 @@ if [ $1 = '-h' -o $1 = '--help' ]; then
exit
0
exit
0
fi
fi
HELPER
=
$1
if
[
!
-x
"
$HELPER
"
]
;
then
echo
"
$HELPER
cannot be executed"
exit
1
fi
shift
PARALLELISM
=
$1
PARALLELISM
=
$1
shift
shift
STATE_DIR
=
$1
STATE_DIR
=
$1
...
@@ -30,5 +24,6 @@ if [ $# -eq 0 ]; then
...
@@ -30,5 +24,6 @@ if [ $# -eq 0 ]; then
exit
1
exit
1
fi
fi
xargs
-0
-r
-n
1
-P
$PARALLELISM
-I
"@FILE@"
"
$HELPER
"
"@FILE@"
"
$STATE_DIR
"
"
$@
"
# 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
"
"
$@
"
"
$@
"
--out
"
$OUT_FILE
"
--state-file
"
$STATE_DIR
"
/
*
"
$@
"
--out
"
$OUT_FILE
"
--state-file
"
$STATE_DIR
"
/
*
parallel_parse_helper.sh
deleted
100755 → 0
View file @
98141ebe
#!/bin/bash
INFILE
=
$1
shift
STATE_DIR
=
$1
shift
echo
-n
'.'
exec
"
$@
"
-Q
--format
json
--out
"
$STATE_DIR
/
$(
sed
s:/:@:g
<<<
"
$INFILE
"
)
.json"
"
$INFILE
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment