ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am new to bash scripting,I am writing a script to find world writeable directories.and in that directoires i want to find some specific file type like php.cgi.and few more,I am using the following command to do the this job,But when i have there world writeable directories,i am unable to find these file type,plz suggest and give some code for help aslo thx
Then what you need to do is present the code you have constructed, thus showing what you have done, and ask what is wrong with it or how it might be improved.
You do this to show people here that you ARE putting in the effort and just haven't figured something out. You do that and someone is probably going to step forward and help you.
When you simply say (as you have) that you want someone to do your homework for you, no one at all will lift a finger.
edit: In the find statement you provided, you specified that you were looking for directories. Directories are what you are getting. What else would you expect?
You've got the directories you need, now all you need to do is get the contents of the directories('ls') and grep for what you're looking for.
p.s. Working all weekend should have gotten you much further than this. Have you read your textbook? Lots of times teachers will draw on examples from textbooks to formulate their questions.
I have worked over they weekend but didnt find any thing.I am realy try hard but not luck.
What have you tried? What errors have you gotten?
This does seem alot like homework to me, too. Try to Google for a solution....I found a three scripts and numerous commands on the first page of results alone.
Thx TB0ne this not home work i have similar script in php but my boss want in bash,and i am not sound in bash,i have problem that when find command return result i store in a variable,but there are many dir in that variable i dont seem to got any idea how to process each dir to find file that have extension like php cgi etc.
Well, guys, have fun. You can answer him if you wish, but I'll point out that my first post said "homework" and his response implicitly agreed because he had worked hard on it over the weekend. But now it is something for his job and his boss wants it in bash rather than php.
And he still has not provided code samples other than the find statement. The PHP code could provide all kinds of valuable clues. LOL.
You can believe him if you want to; I certainly don't believe him.
Thx TB0ne this not home work i have similar script in php but my boss want in bash,and i am not sound in bash,i have problem that when find command return result i store in a variable,but there are many dir in that variable i dont seem to got any idea how to process each dir to find file that have extension like php cgi etc.
Re-read my first post. If you google for this, you'll find lots of results. If this is for your work, you can tell your boss you don't know bash, and they'll give it to someone else, or give you time to work on it.
As before, we've asked to see what YOU'VE ALREADY DONE, and you haven't provided it. Go look up the answer, or find one of the thousands of bash tutorials that are available on the web. If you're an experienced PHP programmer, you shouldn't have problems with a very simple task in a scripting language.
thx TB0ne find very usefull thing like i tell u and i have time to make this script,time dont matter but,let me tell you what i have find,But i must say people in this forum are not professionals,expect you.thx any way to all.
find /var/www/html -type d -perm 777 -print -exec ls -la {} \; | grep -i .php
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.