2012-11-22 11:10:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-11-22 22:19:00 +00:00
|
|
|
seq 1 2 >/tmp/in12
|
|
|
|
seq 4 5 >/tmp/in45
|
|
|
|
|
2012-11-22 11:10:45 +00:00
|
|
|
echo "### Test basic --shebang-wrap"
|
2012-11-22 22:19:00 +00:00
|
|
|
cat <<EOF > /tmp/basic--shebang-wrap
|
2013-08-21 15:04:33 +00:00
|
|
|
#!/usr/local/bin/parallel --shebang-wrap -k /usr/bin/perl
|
2012-11-22 11:10:45 +00:00
|
|
|
|
|
|
|
print "Shebang from perl with args @ARGV\n";
|
|
|
|
EOF
|
|
|
|
|
2012-11-22 22:19:00 +00:00
|
|
|
chmod 755 /tmp/basic--shebang-wrap
|
|
|
|
/tmp/basic--shebang-wrap arg1 arg2
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test basic --shebang-wrap Same as"
|
2013-08-21 15:04:33 +00:00
|
|
|
parallel -k /usr/bin/perl /tmp/basic--shebang-wrap ::: arg1 arg2
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test basic --shebang-wrap stdin"
|
2012-11-22 22:19:00 +00:00
|
|
|
(echo arg1; echo arg2) | /tmp/basic--shebang-wrap
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test basic --shebang-wrap Same as"
|
2013-08-21 15:04:33 +00:00
|
|
|
(echo arg1; echo arg2) | parallel -k /usr/bin/perl /tmp/basic--shebang-wrap
|
2012-11-22 22:19:00 +00:00
|
|
|
rm /tmp/basic--shebang-wrap
|
|
|
|
|
2012-11-22 11:10:45 +00:00
|
|
|
|
|
|
|
echo "### Test --shebang-wrap with parser options"
|
2012-11-22 22:19:00 +00:00
|
|
|
cat <<EOF > /tmp/with-parser--shebang-wrap
|
2012-12-02 20:11:27 +00:00
|
|
|
#!/usr/local/bin/parallel --shebang-wrap -k /usr/bin/perl -p
|
2012-11-22 11:10:45 +00:00
|
|
|
|
|
|
|
print "Shebang from perl with args @ARGV\n";
|
|
|
|
EOF
|
|
|
|
|
2012-11-22 22:19:00 +00:00
|
|
|
chmod 755 /tmp/with-parser--shebang-wrap
|
|
|
|
/tmp/with-parser--shebang-wrap /tmp/in12 /tmp/in45
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test --shebang-wrap with parser options Same as"
|
2012-12-02 20:11:27 +00:00
|
|
|
parallel -k /usr/bin/perl -p /tmp/with-parser--shebang-wrap ::: /tmp/in12 /tmp/in45
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test --shebang-wrap with parser options stdin"
|
2012-11-22 22:19:00 +00:00
|
|
|
(echo /tmp/in12; echo /tmp/in45) | /tmp/with-parser--shebang-wrap
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test --shebang-wrap with parser options Same as"
|
2012-12-02 20:11:27 +00:00
|
|
|
(echo /tmp/in12; echo /tmp/in45) | parallel -k /usr/bin/perl /tmp/with-parser--shebang-wrap
|
2012-11-22 22:19:00 +00:00
|
|
|
rm /tmp/with-parser--shebang-wrap
|
|
|
|
|
|
|
|
|
|
|
|
echo "### Test --shebang-wrap --pipe with parser options"
|
|
|
|
cat <<EOF > /tmp/pipe--shebang-wrap
|
2012-12-28 20:30:30 +00:00
|
|
|
#!/usr/local/bin/parallel --shebang-wrap -k --pipe /usr/bin/perl -p
|
2012-11-22 11:10:45 +00:00
|
|
|
|
2012-11-22 22:19:00 +00:00
|
|
|
print "Shebang from perl with args @ARGV\n";
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod 755 /tmp/pipe--shebang-wrap
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test --shebang-wrap --pipe with parser options stdin"
|
2012-11-22 22:19:00 +00:00
|
|
|
cat /tmp/in12 /tmp/in45 | /tmp/pipe--shebang-wrap
|
2012-12-28 20:30:30 +00:00
|
|
|
echo "### Test --shebang-wrap --pipe with parser options Same as"
|
|
|
|
cat /tmp/in12 /tmp/in45 | parallel -k --pipe /usr/bin/perl\ -p /tmp/pipe--shebang-wrap
|
2012-11-22 22:19:00 +00:00
|
|
|
rm /tmp/pipe--shebang-wrap
|
2012-11-22 11:10:45 +00:00
|
|
|
|
2012-11-22 22:19:00 +00:00
|
|
|
rm /tmp/in12
|
|
|
|
rm /tmp/in45
|