Linux bash scripting

Go down

Linux bash scripting Empty Linux bash scripting

Post by Guest Thu Jun 12, 2014 7:22 am

Hi guys...

any linux genius here who can help me how to write a shell script with following requirements

What directory would the user like a listing of?

What directory would the user like the output file to be stored in, remind the user that they will need write permission to the selected directory.

What should the output file be named?

in simple terms as possible.

much appreciated...


Guest
Guest


Back to top Go down

Linux bash scripting Empty Re: Linux bash scripting

Post by Guest Thu Jun 12, 2014 7:30 am

also if u guys suggest any linux book for beginners.. would be much appreciated... the book that is used in our college is shit!!!!! everything is so mixed up and confusing... and incomplete.

Guest
Guest


Back to top Go down

Linux bash scripting Empty Re: Linux bash scripting

Post by rwo power Thu Jun 12, 2014 8:04 am

Hm. I learned all my UNIX/Linux by doing.

I would like to help you, but for some reason I do not really understand what exactly you want to do with that script.
rwo power
rwo power
Super Moderator
Super Moderator

Club Supported : Asante Kotoko
Posts : 20978
Join date : 2011-06-05

Back to top Go down

Linux bash scripting Empty Re: Linux bash scripting

Post by Guest Thu Jun 12, 2014 8:08 am

rwo power wrote:Hm. I learned all my UNIX/Linux by doing.

I would like to help you, but for some reason I do not really understand what exactly you want to do with that script.


i would like to make a script that would ask a user to list directory they choose then storing in output file(this is not problem) and remind user about permission of selected directory.

i want to try to run it in my computer. this is part of the tutorial, and we will have similar tutorial coming up in class which will give me bonus credit.

i really need help because my book really sucks!!

Guest
Guest


Back to top Go down

Linux bash scripting Empty Re: Linux bash scripting

Post by rwo power Thu Jun 12, 2014 8:15 am

Well, to list a directory and put the contents into a file, just use

Code:
ls -la $1 > $2
echo Here comes your text

to use it, just type
sh ./name-of-script DIRECTORY FILE

And behind the "echo" just write whatever text you want to write to remind the user. Or did I misunderstand what you want?
rwo power
rwo power
Super Moderator
Super Moderator

Club Supported : Asante Kotoko
Posts : 20978
Join date : 2011-06-05

Back to top Go down

Linux bash scripting Empty Re: Linux bash scripting

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum