title: how to grab 2nd field of first line of a pipe delimited text file stored in hfds through shell script
body: <p>I am new to Unix commands.
  I have a pipe delimited test file in hdfs. I want to grab second field of the first line from the file through shell script and store it in variable.
  To read the first line I used the following command but its showing error of <code>-head unknown command</code></p>
  
  <pre><code>line=$(hadoop fs -head -n 1 $new_file)
  </code></pre>
  
  <p>I know for grabbing second field of a line we can use</p>
  
  <pre><code>y=$(echo $x | awk '{print $2}')
  
  echo $y
  </code></pre>
  
  <p>where y will be the first line of the file</p>