The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-25-2006
napolayan napolayan is offline
Registered User
 

Join Date: Oct 2006
Location: Bangalore, India
Posts: 41
Setting FS to more than one character

Hi!

In an awk tutorial i was reading (from www.grymoire.com), it was mentioned that i can set the input field separator to more than one character using FS. However when i tried it out, it wasnt working.

File a :

abc/:/:as
as/:f/:f
AE/:/:as/:/:s


script a.sh

#!/bin/awk -f
BEGIN {
FS="/:";
}

{
print $1, $2;
}



command:

home/# as.sh<a
abc :
as :f
AE :


however, the output i shud get is
abc
as f
AE

can someone tell me what am i doing wrong here?
Reply With Quote
Forum Sponsor