fork download
  1. $
  2. list="cricket frog cat dog"
  3. poem="I wanna be a x\n\
  4. A x is what I'd love to be\n\
  5. If I became a x\n\
  6. How happy I would be.\n"
  7. for critter in $list; do
  8. echo -e ${poem//x/$critter}
  9. done
  10. $
Runtime error #stdin #stdout 0.03s 5316KB
stdin
Standard input is empty
stdout
I wanna be a cricket
A cricket is what I'd love to be
If I became a cricket
How happy I would be.

I wanna be a frog
A frog is what I'd love to be
If I became a frog
How happy I would be.

I wanna be a cat
A cat is what I'd love to be
If I became a cat
How happy I would be.

I wanna be a dog
A dog is what I'd love to be
If I became a dog
How happy I would be.