title: How to get output of grep in single line in shell script?
body: <p>Here is a script which reads words from the file replaced.txt and displays the output each word in each line, But I want to display all the outputs in a single line.</p>
  
  <pre>
  #!/bin/sh
   echo
   echo "Enter the word to be translated"
   read a
  IFS=" "     # Set the field separator
  set $a      # Breaks the string into $1, $2, ...
  for a    # a for loop by default loop through $1, $2, ...
      do
      {
      b= grep "$a" replaced.txt | cut -f 2 -d" " 
      }
      done 
  </pre>
  
  <p>Content of "replaced.txt" file is given below:</p>
  
  <pre>
  hllo HELLO
  m AM
  rshbh RISHABH
  jn JAIN
  hw HOW 
  ws WAS 
  ur YOUR
  dy DAY
  </pre>
  
  <p>This question can't be appropriate to what I asked, I just need the help to put output of the script in a single line.</p>