The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-02-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,091
When you say:

Code:
$1 ~ /^A[1]$/

That would be equivalent (if it worked) to:

Code:
$1 == A[1]

You can't use / ... / to do what you are trying to do.

Have a look at:
The GNU Awk User's Guide
(7.5 Scanning All Elements of an Array)