2010-11-02 16:10:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-11-13 13:57:39 +00:00
|
|
|
SERVER1=parallel-server3
|
|
|
|
SERVER2=parallel-server2
|
|
|
|
|
2010-11-02 16:10:19 +00:00
|
|
|
echo '### Test $PARALLEL'
|
|
|
|
PARALLEL="-k
|
|
|
|
-j1
|
|
|
|
echo" parallel ::: a b c
|
|
|
|
|
|
|
|
PARALLEL="-k
|
|
|
|
--jobs
|
|
|
|
1
|
|
|
|
echo" parallel ::: a b c
|
|
|
|
|
|
|
|
PARALLEL="-k
|
|
|
|
--jobs 1
|
|
|
|
echo" parallel ::: a b c
|
|
|
|
|
|
|
|
PARALLEL="-k
|
|
|
|
--jobs
|
|
|
|
1
|
|
|
|
echo 1" parallel -v echo 2 ::: a b c
|
|
|
|
|
|
|
|
PARALLEL="-k --jobs 1 echo" parallel ::: a b c
|
|
|
|
PARALLEL="-k --jobs 1 echo 1" parallel -v echo 2 ::: a b c
|
|
|
|
|
|
|
|
echo '### Test ugly quoting from $PARALLEL'
|
|
|
|
PARALLEL="-k --jobs 1 perl -pe '\$a=1; print\$a'" parallel -v ::: <(echo a) <(echo b)
|
2011-07-20 23:58:23 +00:00
|
|
|
PARALLEL='-k --jobs 1 -S '$SERVER1' perl -pe "\\$a=1; print\\$a"' parallel -v '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test ugly quoting from profile file'
|
2010-11-13 13:57:39 +00:00
|
|
|
cat <<EOF >~/.parallel/test_profile
|
2011-04-08 22:09:00 +00:00
|
|
|
# testprofile
|
2010-11-02 16:10:19 +00:00
|
|
|
-k --jobs 1 perl -pe '\$a=1; print \$a'
|
|
|
|
EOF
|
2010-11-13 13:57:39 +00:00
|
|
|
parallel -v -J test_profile ::: <(echo a) <(echo b)
|
2010-11-02 16:10:19 +00:00
|
|
|
|
2011-07-20 23:58:23 +00:00
|
|
|
PARALLEL='-k --jobs 1 echo' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -v ::: foo
|
|
|
|
PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a"' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -vv '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of $ in command from profile file'
|
2010-11-13 13:57:39 +00:00
|
|
|
cat <<EOF >~/.parallel/test_profile
|
2010-11-02 16:10:19 +00:00
|
|
|
-k --jobs 1 perl -pe '\\\$a=1; print \\\$a'
|
|
|
|
EOF
|
2011-07-20 23:58:23 +00:00
|
|
|
parallel -v -J test_profile -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of $ in command from $PARALLEL'
|
2011-07-20 23:58:23 +00:00
|
|
|
PARALLEL='-k --jobs 1 perl -pe "\\$a=1; print \\$a" ' parallel -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 -v '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of space in arguments (-S) from profile file'
|
2010-11-13 13:57:39 +00:00
|
|
|
cat <<EOF >~/.parallel/test_profile
|
|
|
|
-k --jobs 1 -S ssh\ $SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a'
|
2010-11-02 16:10:19 +00:00
|
|
|
EOF
|
2011-07-20 23:58:23 +00:00
|
|
|
parallel -v -J test_profile '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of space in arguments (-S) from $PARALLEL'
|
2011-07-20 23:58:23 +00:00
|
|
|
PARALLEL='-k --jobs 1 -S ssh\ '$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of space in long arguments (--sshlogin) from profile file'
|
2010-11-13 13:57:39 +00:00
|
|
|
cat <<EOF >~/.parallel/test_profile
|
2011-04-08 22:09:00 +00:00
|
|
|
# testprofile
|
2010-11-13 13:57:39 +00:00
|
|
|
-k --jobs 1 --sshlogin ssh\ $SERVER1\ ssh\ parallel@$SERVER2 perl -pe '\$a=1; print \$a'
|
2010-11-02 16:10:19 +00:00
|
|
|
EOF
|
2011-07-20 23:58:23 +00:00
|
|
|
parallel -v -J test_profile '<(echo {})' ::: foo
|
2010-11-02 16:10:19 +00:00
|
|
|
|
|
|
|
echo '### Test quoting of space in arguments (-S) from $PARALLEL'
|
2011-07-20 23:58:23 +00:00
|
|
|
PARALLEL='-k --jobs 1 --sshlogin ssh\ '$SERVER1'\ ssh\ parallel@'$SERVER2' perl -pe "\\$a=1; print \\$a" ' parallel -v '<(echo {})' ::: foo
|