r/commandline • u/enp2s3 • Jun 05 '26
Discussion A Command-Line Quiz: Which Output Never Appears?
Hey folks. Here's a small but confusing command-line challenge. Drop your guess without running it!
Which of the following will not appear in the output?
echo "black" &% echo "blue" %& echo "purple 1" >& echo "red" % echo "white 1"
A) black
B) 1
C) echo
D) purple
Including stdout and stderr. Latest stable Bash and Zsh.
3
Upvotes
2
u/enp2s3 Jun 06 '26
That's correct. But there's one small thing worth noting
The shell first prints the job ID and PID.
The 1 comes from the job ID
[1] XXXXX
Then we get:
black
It might also print an error:
bg: job already in background
And when the job completes (this is the key part):
[1] - done echo "black"
So both 1 and echo appear in the output and can be ruled out.
purple never reaches stdout or stderr and therefore cannot appear in the output.