#!/bin/sh
# 
# Demonstrate the differing behaviour of the shell 
# script $* and $@ expansions.
#

expansion_star() {
	for arg in $*; do
		echo $arg
	done
}

expansion_quoted_star() {
	for arg in "$*"; do
		echo $arg
	done
}

expansion_at() {
	for arg in $@; do
		echo $arg
	done
}

expansion_quoted_at() {
	for arg in "$@"; do
		echo $arg
	done
}

echo === star
expansion_star "hello" "world" "hello world" "shell script"

echo === quoted star
expansion_quoted_star "hello" "world" "hello world" "shell script"

echo === at
expansion_at "hello" "world" "hello world" "shell script"

echo === quoted at
expansion_quoted_at "hello" "world" "hello world" "shell script"


