Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • The awk gives out an error like this awk: syntax error near line 1 awk: bailing out near line 1 Commented Jun 3, 2014 at 14:56
  • I am using Ksh here . Commented Jun 3, 2014 at 14:56
  • Sorry I am not familiar with the capabilities of your platform's version of awk - in case it does not support the FNR extension, you could try testing the file name instead i.e. awk 'FILENAME=="file2" {a[$1]++}; FILENAME=="file1" && a[$1]' file2 file1 Commented Jun 3, 2014 at 15:13
  • i am using solaris 10 ,even after trying the second method same persists Commented Jun 3, 2014 at 15:49