2010-06-22 13:24:55 +00:00
|
|
|
### Test -p --interactive
|
|
|
|
spawn /tmp/parallel-script-for-expect
|
2011-02-21 01:31:30 +00:00
|
|
|
sleep 0.1; echo opt-p 1 ?...y
|
|
|
|
sleep 0.1; echo opt-p 2 ?...n
|
|
|
|
sleep 0.1; echo opt-p 3 ?...y
|
2010-06-22 13:24:55 +00:00
|
|
|
opt-p 1
|
|
|
|
opt-p 3
|
2011-02-21 01:31:30 +00:00
|
|
|
sleep 0.1; echo opt--interactive 1 ?...y
|
|
|
|
sleep 0.1; echo opt--interactive 2 ?...n
|
|
|
|
sleep 0.1; echo opt--interactive 3 ?...y
|
2010-06-22 13:24:55 +00:00
|
|
|
opt--interactive 1
|
|
|
|
opt--interactive 3
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -L -l and --max-lines
|
2011-01-11 12:42:14 +00:00
|
|
|
a_b
|
|
|
|
c
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs -L1 echo
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b
|
|
|
|
c
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b
|
|
|
|
c
|
|
|
|
a_b
|
|
|
|
c
|
2011-01-25 23:34:08 +00:00
|
|
|
Lines ending in space should continue on next line
|
|
|
|
### xargs -L1 echo
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
a_b c
|
|
|
|
d
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c
|
|
|
|
d
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs -L2 echo
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
|
|
|
a_b c d
|
|
|
|
e
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs -l echo
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs -l2 echo
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
|
|
|
a_b c d
|
|
|
|
e
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs -l1 echo
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs --max-lines=2 echo
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c d
|
|
|
|
e
|
|
|
|
a_b c d
|
|
|
|
e
|
2011-01-25 23:34:08 +00:00
|
|
|
### xargs --max-lines echo
|
2010-06-12 23:24:25 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2010-06-25 23:56:14 +00:00
|
|
|
a_b c
|
|
|
|
d
|
|
|
|
e
|
2010-06-12 23:24:25 +00:00
|
|
|
### test too long args
|
2011-07-16 23:46:02 +00:00
|
|
|
parallel: Command line too long (1000005 >= 131071) at number 1: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
|
2010-06-12 23:24:25 +00:00
|
|
|
xargs: argument line too long
|
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
9 10
|
2011-07-16 23:46:02 +00:00
|
|
|
parallel: Command line too long (1000007 >= 10) at number 5: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
|
2010-06-12 23:24:25 +00:00
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
xargs: argument line too long
|
|
|
|
9 10
|
2010-06-25 23:56:14 +00:00
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
9 10
|
2011-07-16 23:46:02 +00:00
|
|
|
parallel: Command line too long (1000007 >= 10) at number 5: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -x
|
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
2010-11-22 09:35:53 +00:00
|
|
|
9 10
|
2011-07-16 23:46:02 +00:00
|
|
|
parallel: Command line too long (10 >= 10) at number 5: 12345...
|
2010-06-12 23:24:25 +00:00
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
2010-06-25 23:56:14 +00:00
|
|
|
7 8
|
2010-11-22 09:35:53 +00:00
|
|
|
9 10
|
2011-07-16 23:46:02 +00:00
|
|
|
parallel: Command line too long (10 >= 10) at number 5: 12345...
|
2010-06-25 23:56:14 +00:00
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
2010-06-12 23:24:25 +00:00
|
|
|
xargs: argument line too long
|
|
|
|
7 8
|
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
9 10
|
|
|
|
1234
|
|
|
|
12
|
|
|
|
13
|
|
|
|
14
|
|
|
|
15
|
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
9 10
|
|
|
|
1234
|
|
|
|
12
|
|
|
|
13
|
|
|
|
14
|
|
|
|
15
|
2010-06-25 23:56:14 +00:00
|
|
|
1 2
|
|
|
|
3 4
|
|
|
|
5 6
|
|
|
|
7 8
|
|
|
|
9 10
|
|
|
|
1234
|
|
|
|
12
|
|
|
|
13
|
|
|
|
14
|
|
|
|
15
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -a and --arg-file: Read input from file instead of stdin
|
2010-02-03 23:54:06 +00:00
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
|
|
|
1
|
|
|
|
2
|
|
|
|
3
|
|
|
|
4
|
|
|
|
5
|
|
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
|
|
9
|
|
|
|
10
|
2010-06-12 23:24:25 +00:00
|
|
|
xargs Expect: 3 1 2
|
2010-04-21 19:28:00 +00:00
|
|
|
3
|
|
|
|
1
|
|
|
|
2
|
2010-09-05 10:22:08 +00:00
|
|
|
parallel Expect: 3 1 via psedotty 2
|
2010-06-12 23:24:25 +00:00
|
|
|
3
|
|
|
|
1
|
2010-09-05 10:22:08 +00:00
|
|
|
via pseudotty
|
2010-06-12 23:24:25 +00:00
|
|
|
2
|
|
|
|
xargs Expect: 1 3 2
|
|
|
|
1
|
|
|
|
3
|
|
|
|
2
|
2010-09-05 10:22:08 +00:00
|
|
|
parallel Expect: 1 3 2 via pseudotty
|
2010-04-21 19:28:00 +00:00
|
|
|
1
|
|
|
|
3
|
|
|
|
2
|
2010-09-05 10:22:08 +00:00
|
|
|
via pseudotty
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -i and --replace: Replace with argument
|
2010-02-03 23:54:06 +00:00
|
|
|
replace
|
|
|
|
replace
|
|
|
|
replace
|
|
|
|
replace
|
|
|
|
replace
|
|
|
|
replace
|
|
|
|
replace
|
2010-04-13 14:05:21 +00:00
|
|
|
replace
|
|
|
|
replace
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -E: Artificial end-of-file
|
2010-02-03 23:54:06 +00:00
|
|
|
include this
|
|
|
|
include this
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -e and --eof: Artificial end-of-file
|
2010-02-03 23:54:06 +00:00
|
|
|
include this
|
|
|
|
include this
|
|
|
|
include this
|
|
|
|
include this
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test -n and --max-args: Max number of args per line (only with -X and -m)
|
2010-02-03 23:54:06 +00:00
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
2010-06-25 23:56:14 +00:00
|
|
|
line 1 line 1
|
|
|
|
line 2
|
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
2010-02-03 23:54:06 +00:00
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
2010-06-25 23:56:14 +00:00
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --max-procs and -P: Number of processes
|
2010-04-13 20:59:39 +00:00
|
|
|
max proc 1
|
|
|
|
max proc 2
|
|
|
|
max proc 3
|
|
|
|
max proc 4
|
|
|
|
max proc 5
|
|
|
|
max proc 6
|
|
|
|
max proc 7
|
|
|
|
max proc 8
|
|
|
|
max proc 9
|
|
|
|
max proc 10
|
|
|
|
200% proc 1
|
|
|
|
200% proc 2
|
|
|
|
200% proc 3
|
|
|
|
200% proc 4
|
|
|
|
200% proc 5
|
|
|
|
200% proc 6
|
|
|
|
200% proc 7
|
|
|
|
200% proc 8
|
|
|
|
200% proc 9
|
|
|
|
200% proc 10
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --delimiter and -d: Delimiter instead of newline
|
|
|
|
# Yes there is supposed to be an extra newline for -d N
|
2010-02-03 23:54:06 +00:00
|
|
|
This is line 1
|
|
|
|
This is line 2
|
|
|
|
This is line 3
|
|
|
|
|
|
|
|
This is line 1
|
|
|
|
This is line 2
|
|
|
|
This is line 3
|
|
|
|
|
2010-04-13 20:59:39 +00:00
|
|
|
delimiter NUL line 1
|
2010-02-03 23:54:06 +00:00
|
|
|
line 2
|
|
|
|
line 3
|
2010-04-13 20:59:39 +00:00
|
|
|
delimiter TAB line 1
|
2010-02-03 23:54:06 +00:00
|
|
|
line 2
|
|
|
|
line 3
|
2010-11-13 13:57:39 +00:00
|
|
|
### Hans found a bug giving unitialized variable
|
|
|
|
gzip /tmp/parallel_f1
|
|
|
|
gzip /tmp/parallel_f2'
|
|
|
|
'
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --max-chars and -s: Max number of chars in a line
|
2010-02-03 23:54:06 +00:00
|
|
|
line 1 line 1
|
|
|
|
line 2
|
|
|
|
line 1 line 1
|
|
|
|
line 2
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --no-run-if-empty and -r: This should give no output
|
|
|
|
### Test --help and -h: Help output (just check we get the same amount of lines)
|
2010-04-18 14:18:31 +00:00
|
|
|
Output from -h and --help
|
2011-07-16 23:46:02 +00:00
|
|
|
22
|
|
|
|
22
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --version: Version output (just check we get the same amount of lines)
|
2011-03-20 21:40:12 +00:00
|
|
|
12
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --verbose and -t
|
2010-02-03 23:54:06 +00:00
|
|
|
echo bar
|
|
|
|
echo car
|
|
|
|
echo far
|
|
|
|
echo bar
|
|
|
|
echo car
|
|
|
|
echo far
|
2010-06-12 23:24:25 +00:00
|
|
|
### Test --show-limits
|
2010-04-21 19:28:00 +00:00
|
|
|
Maximal size of command: 131071
|
|
|
|
Maximal used size of command: 131071
|
|
|
|
|
|
|
|
Execution of will continue now, and it will try to read its input
|
|
|
|
and run commands; if this is not what you wanted to happen, please
|
|
|
|
press CTRL-D or CTRL-C
|
|
|
|
bar
|
|
|
|
car
|
|
|
|
far
|
|
|
|
Maximal size of command: 131071
|
|
|
|
Maximal used size of command: 100
|
|
|
|
|
|
|
|
Execution of will continue now, and it will try to read its input
|
|
|
|
and run commands; if this is not what you wanted to happen, please
|
|
|
|
press CTRL-D or CTRL-C
|
2010-06-25 23:56:14 +00:00
|
|
|
bar car far
|