A Personalized Echo

  • + 0 comments

    I know this is a beginner-level challenge, but I'm surprised the test cases are so kind. The echo command does not emit all its input completely literally—it will transform escaped characters, for example. And feeding the input through read and then double-quoted string can mangle things too.

    $ read name; echo "Welcome $name"
    \n\tChuckles\n\t
    Welcome ntChucklesnt
    
    $ printf 'Welcome %s\n' $(cat)
    \n\tChuckles\n\t
    Welcome \n\tChuckles\n\t