title: Minor issue with bash scripting to make a function accept all arguments after initial function call as a single string
body: <p>I'm trying to write a simple bash script that accepts all arguments and interprets them simply as a string.</p>
  
  <p>In other words:
  <code>tweet Testing out my command-line tweetings.  #commandlinetweets</code></p>
  
  <p>Takes in all the arguments and just uses them bluntly as a string.</p>
  
  <p>Here is the basic form that I have at the moment:</p>
  
  <pre><code>function tweet()
  {
  echo "Tweeting using curl."
  curl -u tchalvak "http://twitter.com/statuses/update.xml" -d status="$@"
  echo "Tweet done if spammed info back above."
  echo "Tweeted using username tchalvak with status $@"
  }
  </code></pre>
  
  <p>Right now the erroneous result of running the function is:</p>
  
  <pre><code>$ tweet TEst again and again and again.
  Tweeting using curl.
  Enter host password for user 'tchalvak':
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;hash&gt;
    &lt;request&gt;/statuses/update.xml&lt;/request&gt;
    &lt;error&gt;Status is a duplicate.&lt;/error&gt;
  &lt;/hash&gt;
  curl: (6) Couldn't resolve host 'again'
  curl: (6) Couldn't resolve host 'and'
  curl: (6) Couldn't resolve host 'again'
  curl: (6) Couldn't resolve host 'and'
  curl: (6) Couldn't resolve host 'again.'
  Tweet done if spammed info back above.
  Tweeted using username tchalvak with status TEst again and again and again.
  </code></pre>
  
  <p>So how do I get from multiple arguments to "all these technically multiple arguments should be counted as just one string variable inside the function"?</p>
  
  <p><strong>Edit</strong>: Sorry, I should clarify that I figured I'd just hardcode the username for maximum bulletproofing of the tweeting syntax.</p>
  
  <p>Final solution (as long as you ignore command interpretation issues like <code>#</code> hashes not coming through and similar problems that this dirty method is going to cause, heh):</p>
  
  <pre><code>function tweet()
  {
  STATUS="$*"
  echo "Tweeting using curl."
  curl -u tchalvak "http://twitter.com/statuses/update.xml" -d status="$STATUS"
  echo "Tweet done if spammed info back above."
  echo "Tweeted using username tchalvak with status $STATUS"
  }
  </code></pre>