Question of grep

As i understand the filter process of grep i was wondering, is it possible to to have a hidden word in a file(eg ------) and then use the grep filter to find a specific letter in that word which you can then replace with the letter in that word (eg ---a--) if it is please show me an example if it isnt which is the best form to use to change and display what i am trying to do:b:

Are you trying to do steganography? Your example isn't clear to me. grep is not normally used to add something that isn't there already. It just searches, sed is used to change data.

The idea is to have some words within another file and then use a random select to get a word from that file and then generate as ----- so it is hidden from the user. From that they have to guess the letter and with the simple input they give this would then search the word for the letter and then replace it with the users inputted letter so ----a-- as an eg. The question is can grep be used if so or if not how to do this.

A Hangman game? Just grep is not sufficient, no. Like Jim already told you, grep can find lines in a file which match a particular pattern, but it just prints them, nothing more. In particular, it doesn't replace characters with other characters; nor does it have loops (other than the input loop for reading in the file, one line at a time, and print those lines which match the specified pattern. If you are really clever you could perhaps use that to drive something ...)

Google for "Hangman source code" or visit the "99 bottles of beer" site.

Yeah thats right something like hangman do you have any examples for me to see what the script would look like

See the followint link:
http://www.unix.com/unix-dummies-questions-answers/53841-matching-string.html

WORD="nasty"
cnt=0
known="n"
while [ $known = "n" ]
do
   echo -e "Input a char: \c"
   read CHAR
   CHARS="${CHARS}${CHAR}"
   ((cnt = cnt + 1))
   disp=$(echo "$WORD" | sed "s/[^${CHARS}]/-/g")
   echo $disp
   if [ $WORD = $disp ]
      then
      known="y"
   fi
done 
echo $cnt" guesses"

Yes examples: google for hangman source code
Our own zazzybob has a nice one on his site:
[ z a z z y b o b . c o m ] $HOME/games/shangman