The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-26-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?