Issue with parsing echo text (Stage #NI6)

I’m stuck on Stage #NI6.

The instructions on the website say the following:

It’ll then send a series of echo commands to your shell:

$ echo 'shell hello'
shell hello
$ echo 'world     test'
world     test
$

I’ve coded my result to maintain any spaces within quoted text as shown in the stage instructions, however the tester says that my result is wrong:

[tester::#NI6] Running tests for Stage #NI6 (Quoting - Single quotes)
[tester::#NI6] Running ./your_program.sh
[your-program] $
[tester::#NI6] > echo 'example shell'
[your-program] example shell
[tester::#NI6] ✓ Received expected response
[your-program] $
[tester::#NI6] > echo shell     script
[your-program] shell     script
[tester::#NI6] Expected: "shell script"
[tester::#NI6] Received: "shell     script"
[your-program] $
[tester::#NI6] Received output does not match expectation.
[tester::#NI6] Test failed

I’d appreciate some assistance to figure out where I’m going wrong.

Hi @retop56, echo shell script doesn’t use any quotes, so the multiple spaces are not preserved and treated as a single space.

TBH, I found it a bit confusing at first too!

I was able to pass the stage because of your help. Thank you, not just for this, but for everything else you do as well! :slight_smile:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.