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 -->
  #1 (permalink)  
Old 03-15-2008
phamp008 phamp008 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 36
bash awk codes to perl

Hi,

I am interesting in writing the following bash codes into perl

My script is simple take field 2 in /etc/passwd and put into an array

#!/bin/bash
PASSWD_FILE=/etc/passwd
A=(`awk -F: ' { print $2 }' $PASSWD_FILE `)

Can someone give me equivalent codes in perl ?