Linux bash scripting

View previous topic View next topic Go down

Linux bash scripting

Post by JespSwe on 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...


_________________
人生は宝探しに似ている…
やっと見つけた 君という名の宝箱
あとは心の鍵を そっと開けるだけ...


On Pato, "Did you comb your hair whilst standing in a wind tunnel?" - Gattuso

JespSwe
First Team
First Team

Club Supported : AC Milan
Posts : 3946
Join date : 2011-07-09

Back to top Go down

Re: Linux bash scripting

Post by JespSwe on 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.

_________________
人生は宝探しに似ている…
やっと見つけた 君という名の宝箱
あとは心の鍵を そっと開けるだけ...


On Pato, "Did you comb your hair whilst standing in a wind tunnel?" - Gattuso

JespSwe
First Team
First Team

Club Supported : AC Milan
Posts : 3946
Join date : 2011-07-09

Back to top Go down

Re: Linux bash scripting

Post by rwo power on 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
Super Moderator
Super Moderator

Club Supported : Rot-Weiß Oberhausen
Posts : 20920
Join date : 2011-06-05

Back to top Go down

Re: Linux bash scripting

Post by JespSwe on 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!!

_________________
人生は宝探しに似ている…
やっと見つけた 君という名の宝箱
あとは心の鍵を そっと開けるだけ...


On Pato, "Did you comb your hair whilst standing in a wind tunnel?" - Gattuso

JespSwe
First Team
First Team

Club Supported : AC Milan
Posts : 3946
Join date : 2011-07-09

Back to top Go down

Re: Linux bash scripting

Post by rwo power on 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
Super Moderator
Super Moderator

Club Supported : Rot-Weiß Oberhausen
Posts : 20920
Join date : 2011-06-05

Back to top Go down

Re: Linux bash scripting

Post by Sponsored content Today at 12:40 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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