I am trying out bash, and I am trying to make a simple hangman game now.
Everything is working but I don\'t understand how to do one thing:
I am showing the
You don't show what you tried, but parameter expansion works fine.
$ alphabet=abcdefghijklmnopqrstuvwxyz $ word="hello world" $ guesses=aetl $ echo "${word//[^[:space:]$guesses]/*}" *ell* ***l* $ echo "${alphabet//[$guesses]/*}" *bcd*fghijk*mnopqrs*uvwxyz