Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-25-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,434

Code:
header_fname=`awk 'NR==2 { print substr($0,1,length-18) }' $1`
echo $header_fname

or

Code:
#!/bin/ksh
{
  read line
  read line
} < $1
header_fname=${line%??????????????????}
echo $header_fname

Jean-Pierre.