Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
What is the best way to learn shell scripting in an easy way?
When you say "easy way" that is highly subjective, something easy for you may not be easy for me and vice versa.
There's tons of materials on youtube and others that you can learn from. What have you tried already that was not "easy"?
And remember, only practice will make you better at it...
If you have a traditional sysvinit boot, study the startup scripts. List a script at one terminal, try out individual steps at another to see what they actually do (but don't do that as root in case you damage something) and use a third terminal for calling up man pages.
What is the best way to learn shell scripting in an easy way?
Why do you want to learn shell scripting?
Give your other thread, the answer might be: by reading the websites/books/etc recommended by your teacher.
If you have such recommendations but do not find them easily understandable, identify them and explain what you find challenging. That way, people can recommend solutions without the same shortfalls and/or help you past those initial hurdles.
Well, if you want to learn "shell scripting," maybe the very-first thing that you need to learn about is: #!shebang.
If the very-first line in your "shell script" file looks something like #!/usr/bin/php(for example ...), then the shell will immediately launch an instance of the specified "programming-language interpreter," and hand the rest of the contents of the file over to it. "And you will be none the wiser."
And so, what this means is that "you are not-at-all limited to 'shell scripting.'" Any full-featured programming language that is installed on your computer – and usually, there are several – can be used to carry out a "command."
The only "shell" that I am aware of which ever strived to incorporate "a programmingly-serious built-in scripting language" into itself was the Korn shell ... ksh. But it never really gained much traction. The "shebang!" principle was much more elegant. And, if you take a look around, you'll find that many of the "commands" that you use every day are implemented in this way.
The paltry "built-in" scripting capabilities of "the ubiquitous shell" are, most fortunately, irrelevant.
Last edited by sundialsvcs; 04-20-2022 at 05:23 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.