lhunath 1256739946 learn Never expand parameters in ''sh -c'' commands. Use either of these instead: sh -c 'command "$1"' -- "$file" OR file=$file sh -c 'command "$file"' OR sh -c "$(printf 'command %q' "$file")". Same problem with 'ssh', though with 'ssh' only the last alternative works. greycat 1522683283 forget greycat 1522683286 learn sh -c 'commands' argv0 a1 a2 a3 ## The argv0 placeholder can be any string. Don't expand variables like sh -c "foo $bar"; that's a code injection. Use sh -c 'foo "$1"' x "$bar"; see https://mywiki.wooledge.org/CodeInjection