title: How to use sed with user input
body: <p>Script performs two things</p>
  
  <p>1.Enables the user input a file name </p>
  
  <p>2.Enables the user to input a line number to view the content</p>
  
  <pre><code>echo "Enter the file name"
  read fname
    find / -name "$fname" &gt; /tmp/newone.txt
  
  if test $? -eq 0
  then
   {
    echo "File found"
    echo "The no of line in the file $fname is `cat /tmp/newone.txt | wc|awk '{pri
  nt $1}'`"
    echo  "Enter the line no"
    read  lcnt
    sed '"$lcnt" p' "$fname"
   }
  else
   {
     echo "File not found"
   }
  fi
  </code></pre>
  
  <p>Issue 
  1.Getting error in the sed part</p>
  
  <p>Error message "sed: -e expression #1, char 3: extra characters after command"</p>
  
  <p>how to rectify it ?</p>
  
  <p>2.Can i redirect the output of 'find' to a variable </p>
  
  <p>For example</p>
  
  <p>$flloc =/tmp/newone.txt</p>
  
  <p>so i will be able to use '$flloc' instead of the absolute path</p>