#!/usr/bin/perl -w my $nicount = `ip link >/tmp/nic.txt`; open(NICFH, "/tmp/nic.txt") || die "can't open file: $!"; my @NIC = ; foreach my $file (@NIC) { $file =~ s/\d\:\s//; print $file; }