title: How to pass a shell script argument as a variable to be used when executing grep command
body: <p>I have a file called fruit.txt which contains a list of fruit names (apple, banana.orange,kiwi etc).  I want to create a script that allows me to pass an argument when calling the script i.e. script.sh orange which will then search the file fruit.txt for the variable (orange) using grep. I have the following script...</p>
  
  <p>script name and argument as follows:
  script.sh orange</p>
  
  <p>script snippet as follows:</p>
  
  <pre><code>#!/bin/bash
  nameFind=$1
  echo `cat` "fruit.txt"|`grep` | $nameFind 
  </code></pre>
  
  <p>But I get the grep info usage command and it seems that the script is awaiting some additional command etc. Advice greatly appreciated.</p>