hello people ,I am a learner about shell scripts ,I find it very hard to learn .
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.
hello people ,I am a learner about shell scripts ,I find it very hard to learn .
I don't know if you can give a advise to teach me to study Shell Scripts .Thank you !
if you can tell a good web site about shell script learning ,I will be appriciation of you !
Shell scripts at their simplest are just a series of bash commands.
They need to have the #!/bin/bash line and be made executable as jackyopensrc mentions.
Try something simple like a script that mounts your floppy, lists the contents, then unmounts it. Next time you have 3 unlabeled floppies you can see what's on them with one command.
When you see how simple this is you just need some more ideas and a good reference.
Shellscripting is often about extracting information from files and taking actions based on this, or changing text streams, or taking actions based on wether a particular command was successful or not.
Therefore you'll find it well worth to learn commands like sed, awk and grep.
The more commands you know and can use, the easier shellscripting will become.
Don't forget to use the apropos command if you're not sure what command you're looking for...
Also learn how to create loops, if statements and functions.
Arrays can be useful too, but I rarely use them in my scripts so I would give them a lower priority...
before you go on reading Advanced Bash Scripting Guide, like MooktaKiNG suggested, you may try to take an easy intro with
BASH programming HOWTO (http://www.ibiblio.org/pub/Linux/doc...tro-HOWTO.html or you can find it on your linux box), becouse abs advances quite fast and it could be a bit confusing for a newbie (well at least it was for me ).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.