Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by necovek

4 years ago

This is a difference between $@ and "$@" (note the quotes):

  $ cat proba.sh 
  #!/bin/sh
  echo "Using quotes:"
  for i in "$@"; do echo "$i"; done
  echo "No quotes:"
  for i in $@; do echo "$i"; done
  $ ./proba.sh "ho ho ho"
  Using quotes:
  ho ho ho
  No quotes:
  ho
  ho
  ho

1 comment

necovek

Reply

tomcam  4 years ago

Damn I didn’t know that. Thanks

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities