parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unexpected positional replacement strings substitution


From: aero
Subject: Unexpected positional replacement strings substitution
Date: Sat, 11 Feb 2017 18:36:24 +0900

Hi,

I try to execute a shell script like the following form.

p.sh
-----script start--------------------------
#!/bin/bash

SCRIPT=$(cat <<'EOF'
# long shell script
echo $1
echo ${1}
EOF
)

parallel -v "ssh {} bash <<'_PARALLEL'
$SCRIPT
_PARALLEL" ::: localhost
-----script end--------------------------

But I encountered an unexpected problem.
GNU parallel silently replaces {1} of shell "${1}" variable with supplied arguement.

RESULT:
$ ./p.sh
ssh localhost bash <<'_PARALLEL'
# long shell script
echo $1
echo $localhost
_PARALLEL


Can I change gnu parallel's postional strings substitution pattern ?
or
How can I avoid this unexpected replacement with any other method or trick ?
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]