 <p>Created two scripts: one serializes it's arguments to a <code>[a-ZA-Z0-9=_]*</code> strings <a href="http://vi-server.org/vi/bin/serialize.sh" rel="nofollow noreferrer">http://vi-server.org/vi/bin/serialize.sh</a>, other starts this command line (with optional prepended arguments) <a href="http://vi-server.org/vi/bin/deserialize.sh" rel="nofollow noreferrer">http://vi-server.org/vi/bin/deserialize.sh</a>.</p> <p>Serialize:</p> <pre><code>#!/bin/bash n=$#; for ((i=0; i&lt;$n; ++i)); do if [ -z "$1" ]; then echo 1 else printf '%s' "$1" | base64 -w 0 echo fi shift done | tr '\n' '_' echo -n "0" </code></pre> <p>Deserialize:</p> <pre><code>#!/bin/bash if [ -z "$1" ]; then echo "Usage: deserialize data [optional arguments]" echo "Example: \"deserialize cXFx_d3d3_0 eee rrr\"" echo " will execute \"eee rrr qqq www\"" exit 1; fi DATA="$1"; shift i=0 for A in ${DATA//_/' '}; do if [ "$A" == "0" ]; then break; fi if [ "$A" == "1" ]; then A="" fi ARR[i++]=`base64 -d &lt;&lt;&lt; "$A"` done exec "$@" "${ARR[@]}" </code></pre> <p>Example: </p> <pre><code>deserialize `serialize qqq www` echo </code></pre>