[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
parallel treats input as a single token
From: |
John |
Subject: |
parallel treats input as a single token |
Date: |
Thu, 22 Nov 2012 07:22:55 -0800 (PST) |
I have a bash script that expects three tokens that I'd like to push through
parallel. The problem I am experiencing is that when I cat a text file and
pipe it into parallel, the spaces in the tokens are not treated as such; they
are treated as a single token.
Here is a simplified script: ~/bin/action
#!/bin/bash
echo "first = $1"
echo "second = $2"
echo "third = $3"
If I simply run it like so, I get the expected output:
% ~/bin/action a b c
first = a
second = b
third = c
So to use parallel, I place the "a b c" into a text file that I cat and pipe
into parallel but all of the tokens become $1 as you can see:
% echo "a b c" > worklist
% cat worklist | parallel ~/bin/action
defined(@array) is deprecated at /usr/bin/parallel line 211.
(Maybe you should just omit the defined()?)
first = a b c
second =
third =
1) Please help me understand the error of my way.
2) Why am I experiencing the error regarding defined arrays at line 211?
- parallel treats input as a single token,
John <=