Problems regarding shell scripts


Create a program in the "shell script" programming language to display a short message using "echo". Avoid using punctuation for now. Test it.

[solution]


Some punctuation is special to the shell and must be "quoted". Inside single-quotes, all of this special stuff is ignored.

Write an "echo" command which outputs the message

I like this * very * much (really)

[solution]


But single quotes can't be quoted with single quotes. What happens when you run the following file as a shell script? What is going on?

echo 'I don't know'

How about this? (It's different!)

echo 'I don't know much, but at least I ain't lost!'

[solution]


You can also use double-quotes in the shell. The semantics is slightly different, but not in a way which concerns us right now. Use double-quotes to write a shell script which outputs

I don't know

[solution]


[index of CSC 104 test problem categories]
[main course page]