1.

Solve : Reg. unix command?

Answer»

Hi Friends,

      I want to assign the OUPUT of sed followed by cut command to a variable.I am using the syntax as FOLLOWS.


           a=`sed -n "1p" filename | cut -c1-30`
          echo $a

         Please help me regarding this.

Thanks in advance
sreekanthyou don't need to USE 2 tools to get the first 30 CHARACTERS. use HEAD

Code: [Select]a=$(head -c30 file)
echo $a



Discussion

No Comment Found