LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Scripting Help Please (https://www.linuxquestions.org/questions/linux-newbie-8/scripting-help-please-243733/)

Jazinator 10-17-2004 08:22 AM

Scripting Help Please
 
Hello Friends,
I am new to this forum. I am currently in school learning linux and need to write a script that will do the following: (Any help will be greatly appreciated)

I need to create a shell script called Delstar that will accept input, and check to see if the input is a directory file and is readable and writeable. If so, then all ordinary files under that directory should be listed out one by one. For each ordinary file that is writeable, the user should be asked whether or not the file is to be deleted. If the file is to be deleted then it should be deleted and the next file processed. If the file is not to be deleted then it should just move to the next file.

Thanks in advance for any help given. I just can't seem to get my head around this one. Jaz.

acid_kewpie 10-17-2004 09:13 AM

please do not ask for help with your homework. The point of going to school / college is to learn things, not to just blindly cop someone elses work. Say someone decides to take pitty on you and gives you a full example. you copy that and hand it in.. what do you learn from that? Would you seriously take the time to read through it and teach yourself how it does it's thing? The course you are doing this for should come complete with substantial notes, of text references for you to be able to acomplish any task set within it.

http://www.linuxquestions.org/rules.php

Jazinator 10-17-2004 09:26 AM

I do apologize if it seemed like I am looking for someone to do my work for me. This is not the case. I am more looking for an approach to the problem not the entire script written for me. I have tried several different things to make this work and am having no success.

btmiller 10-17-2004 11:14 AM

Here's a hint -- look at the "test" command, assuming this is to be written in a shell script. If you're doing this in C, the stat function will help you.

Draygo 10-17-2004 12:45 PM

If you are just doing simple shell scripting with bash look up on your "if" and your "and" and "or" operators.

brunnopessoa 10-17-2004 01:12 PM

I encourage you to check the following website out and search for Linux bash scripting:

www.ibm.com/developerworks

Jazinator 10-17-2004 06:18 PM

Thank you to all for your help. It has been invaluable.

brunnopessoa 10-17-2004 06:35 PM

Did you search developerWorks?

http://www-106.ibm.com/developerwork...ry/l-bash.html

I'm sure this will help you. Check parts 2 and 3... I think your answer is there.


All times are GMT -5. The time now is 06:07 AM.