The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
List certain file in a folder and make list andrisetia UNIX for Dummies Questions & Answers 1 09-15-2008 02:21 PM
match string in a file to file in a directory Jae Shell Programming and Scripting 5 01-19-2008 01:11 AM
How to match a logical partition to a file garry AIX 1 09-26-2007 10:52 AM
List files that do not match the search pattern olapxpert UNIX for Dummies Questions & Answers 7 04-14-2005 04:49 PM
List files that do not match the search pattern olapxpert IP Networking 1 04-14-2005 03:37 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-20-2008
aliahsan81 aliahsan81 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 62
Unhappy List file in Dir and then match

Hi ALL,

I am making a script that search all then worldwriteable dir in documentroot.I have manage to find all the dir now i want to match each file extension in worldwriteable against a list of array which contain file like php html etc,if i find any file then print dirname. Dont see to get any idea how i do that.i past my code for reiew and comments



#!/bin/bash

list[0]="php"
list[1]="html"
Docroot[0]="/var/www/html/"

export IFS=$'\n'

# Loop through our array.
for x in ${Docroot[@]}
do
# Find all directories & subdirectories
for i in $(find $x -type d -perm /o=w )
do



echo $i

done
done


This is a small output
/var/www/html/test3
/var/www/html/test3/abc
/var/www/html/test3/gallery
/var/www/html/test/abc
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0