3
# Test a simple function to copy some files around.
6
function copy_and_compress
7
echo "Removing ${2}.gz..."
9
echo "Copying ${1} to ${2}..."
11
echo "Compressing ${1}..."
15
for name in /etc/hosts /etc/passwd
16
basename ${name} -> bname
17
copy_and_compress ${name} /tmp/${bname}
21
# Check that argument passing respects quotation.
30
print_args foo bar baz
31
print_args "foo bar baz"
32
print_args 'foo bar baz' "three blind mice" monkey\ shines
35
# Make sure that recursion is stopped at a respectable limit.
38
function endless_recursion
44
echo "Zoiks, endless recursion should have failed..."
46
echo "Endless recursion was stopped correctly."