Using command line, i am running this program. It's working properly. But i have a problem. While displaying the usernames under the "users" folder, i am getting same username (multiple entries). It's because of username contails another folders. How can i solve this problem.
Structure as :/home/sites/abc.com/users/AB/ /home/sites/abc.com/users/CD/ /home/sites/abc.com/users/CD/asd/ /home/sites/abc.com/users/CD/ghf/ /home/sites/abc.com/users/EF/sss/ /home/sites/abc.com/users/EF/bc/
Now , reusult will be stored in the array @store. Array contains ('AB','CD','CD','CD','EF','EF')
But i need a result stored in the array as ('AB','CD','EF')
How can i do that. Waiting for help from perl experts.
Pls go through this code.Regards,#!/usr/bin/perl $arg1 = $ARGV[0]; @filelist = ` find /home/sites/$arg1/users -type d `; chomp @filelist; @store = (); foreach $fle(@filelist) { ($junk, $reqd )=split (/\/users\//,$fle); ($reqd, $junk) = split (/\//,$reqd); push (@store,$reqd); }
20030214 Edit by Corion - fixed formatting, even though this is a duplicate
In reply to (duplicate) Help by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |