title: Assign string with space to variable from command line argument
body: <p>I have to get a string with space(sometimes without)assigned to a variable as input from the command line argument to the script and search the given string in a file.</p>
  
  <p>My script is not considering the space passed to it, instead, it is taking the first word only</p>
  
  <p>I execute as</p>
  
  <pre><code>./search_pattern.sh ticket_no="ticket3456" pattern="Error configuring"
  
  
  for argument in "$@"; do
  
  key="${argument%%=*}"
  
  value="${argument#*=}"
  
  case "${key}" in
  
  pattern)    pattern="${value}";;
  ticket_no)  ticket_no="$value";;
  esac
  
  done
  
  echo "pattern is $pattern"
  
  echo "ticket is $ticket_no"
  </code></pre>
  
  <p>I am getting the output as </p>
  
  <pre><code>  pattern is Error
  
    ticket is ticket3456
  </code></pre>