Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Folder Structure like this:
Using my code i am getting result stored as/home/sites/$arg1/users/XY/ /home/sites/$arg1/users/YZ/bbb/ /home/sites/$arg1/users/BD/ss/ /home/sites/$arg1/users/GD/gg/ /home/sites/$arg1/users/ZX/
But i need to get a result as:XY YZ YZ BD BD GD GD ZX
So pls help me to solve this problem.XY YZ BD GD ZX #!/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); }
edited: Sun Feb 16 17:27:11 2003 by jeffa - title change(was: pls modify this code)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem stripping directory listing
by tachyon (Chancellor) on Feb 15, 2003 at 10:24 UTC | |
|
Re: Problem stripping directory listing
by integral (Hermit) on Feb 15, 2003 at 08:43 UTC | |
|
Re: Problem stripping directory listing
by zengargoyle (Deacon) on Feb 15, 2003 at 08:50 UTC | |
by valdez (Monsignor) on Feb 15, 2003 at 12:04 UTC | |
by jdporter (Paladin) on Feb 15, 2003 at 13:11 UTC | |
by zengargoyle (Deacon) on Feb 15, 2003 at 14:02 UTC | |
|
Re: Problem stripping directory listing
by dws (Chancellor) on Feb 15, 2003 at 07:33 UTC | |
|
Re: Problem stripping directory listing
by steves (Curate) on Feb 15, 2003 at 09:06 UTC |