#!/usr/bin/perl $num_args = $#ARGV + 1; my @list = `ls -lU`; chomp (my @chattr = `lsattr 2>&1 | sort`); my $value = 0; my @chats; my $arg = $ARGV[0]; my $argVal = 0; my $index = 0; foreach my $item (@list) { @chats = split(/ /, $chattr[$value]); if(index($chats[0], "lsattr:") == -1) { print "$item $chats[0] "; } else { print "$item error"; } if (index($chats[0], $arg) != -1) { $argVal++; } $value++; } if ($num_args != 0) { print "$arg: $argVal"; } print "\n\n";