main executable and post-run commands are ignored
If the -r option is provided, the result files specified with
- @XREMOTE_GET will be downloaded there.
+ @XREMOTE_GET will be downloaded there instead of the current
+ directory.
If no argument is provided to @XREMOTE_HOST, and the -h option is
not specified, the environment variable \$XREMOTE_HOST is used
if [[ "${line}" =~ '@XREMOTE' ]]
then
- label=$(echo "${line}" | sed -e 's/^.*@XREMOTE_\([^:]*\):.*$/\1/')
- value=$(echo "${line}" | sed -e 's/^.*@XREMOTE_[^:]*: *\(.*\)$/\1/')
+ label=$(sed -e 's/^.*@XREMOTE_\([^:]*\):.*$/\1/' <<<"${line}")
+ value=$(sed -e 's/^.*@XREMOTE_[^:]*: *\(.*\)$/\1/' <<<"${line}")
case "${label}" in
RESULT_DIR="."
fi
+[[ "${ARG_RESULT_DIR}" ]] && mkdir -p "${ARG_RESULT_DIR}"
+
while read line
do
if [[ "${line}" =~ '@XREMOTE' ]]
then
- label=$(echo "${line}" | sed -e 's/^.*@XREMOTE_\([^:]*\):.*$/\1/')
- value=$(echo "${line}" | sed -e 's/^.*@XREMOTE_[^:]*: *\(.*\)$/\1/')
+ label=$(sed -e 's/^.*@XREMOTE_\([^:]*\):.*$/\1/' <<<"${line}")
+ value=$(sed -e 's/^.*@XREMOTE_[^:]*: *\(.*\)$/\1/' <<<"${line}")
case "${label}" in
POST)
check_remote_is_defined