title: Escaping linux shell arguments
body: <p>I am trying to get rid of "{ }" characters in between shell arguments that have spaces in them. eg:</p>
  
  <p>./cod4_start.sh hello 28960 "HOSTNAME WITH SPACES"</p>
  
  <p>Once I pass "HOSTNAME WITH SPACES" as an argument, even though it's double quoted shell sees hostname as {HOSTNAME WITH SPACES}.</p>
  
  <p>Is there any kind of other argument passing to the script so that I don't have { } characters in my variables ?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#!/usr/bin/expect -f
  set pssword [lrange $argv 0 0]
  set port [lrange $argv 1 1]
  set mod [lrange $argv 2 2]
  set map [lrange $argv 3 3]
  set num [lrange $argv 4 4]
  set hostname [lrange $argv 5 5]
  set rcon [lrange $argv 6 6]
  set password [lrange $argv 7 7]
  set gtype [lrange $argv 8 8]
  set slots [lrange $argv 9 9]
  spawn su - kod -c cd cod4 -c "nohup ./cod4_lnxded +set s_num=$num +set net_port $port +set dedicated 2 +set fs_game mods/$mod +set logfile 0 +set sv_punkbuster 1 +set sv_hostname \'$hostname\' +exec fastdl.cfg +set rcon_password $rcon +set g_password '$password' +set promod_mode match_mr10 +set g_gametype $gtype +set sv_maxclients $slots +set ui_maxclients $slots +map $map"  &gt; /dev/null 2&gt;&amp;1 &amp;
  expect "Password:" { send "$pssword\r" }
  expect "# " { send "q" }
  exit
  </code></pre>