The question tells you to use each of a list of commands and make that command print the string
blotz and nothing else. If your teacher wants to have a newline printed after each
blotz (which is not clear from your question), you could do:
$ echo "blotz"
$ echo "blotz" > file && cat file
$ touch blotz && ls blotz
$ echo blotz | grep b ## This might also include (invisible) color codes
$ echo blotz | grep --color=never b ## This one avoids the color codes
!! is trickier since, by default, it will also print the command run. For example:
$ blotz ## run blotz to get that saved as !!
blotz: command not found
$ echo !! ## print the value of !!
echo blotz ## Unfortunately, this also prints the command being run.
To get around that, you could make a little script:
set -o histexpand
set -o history
And then run it like so:
$ bash foo.sh 2> /dev/null
There might be a clever hack for this using subshells but I haven't been able to find it.
If your teacher doesn't even want the newline, use these instead:
$ echo -n "blotz"
$ echo -n "blotz" > file && cat file
$ touch blotz && ls blotz | tr -d $'\n'
$ echo blotz | grep --color=never b | tr -d $'\n'
And for the
$ bash foo.sh 2> /dev/null | tr -d $'\n'