Shell scripting! Where to start?

Passed Linux+ two months ago. Now trying to learn some scripting stuffs.
Can anyone suggest me where to start/proceed? I know the best way to learn is to do the things in a production environment but that option just aint available to me at the moment. So, Just want to know enough so that I can add that skill into my resume.
Any book/links/suggestions?
Can anyone suggest me where to start/proceed? I know the best way to learn is to do the things in a production environment but that option just aint available to me at the moment. So, Just want to know enough so that I can add that skill into my resume.
Any book/links/suggestions?
Comments
2nd: Unix Shell Programming (3rd Edition): Stephen G. Kochan, Patrick Wood: 9780672324901: Amazon.com: Books
(At least that's what I did. You might be able to find a better 2nd book like "Linux Command Line and Shell Scripting Bible" or even "Classic Shell Scripting" but I've never read either of those so I personally can't recommend)
Try to have goals, such as small scripts or things to automate in while you're learning.
I learned shell scripting because I realized at work I had to type $(command1) and copy and paste a part of the output into $(command2). I thought to make a script to combine the two steps so I only had to call 1 script. The result took me almost the entirety of the 1st book (2 weeks) and ended up being the ugliest 2-line script in the world. But it worked. From there I just kept making more scripts, each one slightly larger and/or more sophisticated than the last.
I'm by no means a programmer/developer. But I've been a better shell scripter than almost all my fellow operations co-workers from those 2 books alone.
If you've passed the Linux+ it'll probably be a pretty painless journey for you. You'll just need to learn some very, very basic sed+awk, some cut, tr, grep, loops, command substitution, input redirection, etc. If you already know the difference between a for loop and a while loop, you're pretty much there already.
Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
To-do | In Progress | Completed
You could first learn how to declare variables and put them through conditionals.
no, no, no, no. Your production environment isn't for learning. You do your learning in an environment where you can make plenty of mistakes (because you will). We test the scripts that are run in production not only to make sure they work properly, but to also avoid unintended consequences.
Certs: RHCSA, LFCS: Ubuntu, CNCF CKA, CNCF CKAD | AWS Certified DevOps Engineer, AWS Solutions Architect Pro, AWS Certified Security Specialist, GCP Professional Cloud Architect
Learn: Terraform, Kubernetes, Prometheus & Golang | Improve: Docker, Python Programming
To-do | In Progress | Completed
@Clarson- I actually meant learning and gaining experience by doing it in real. Thanks.
http://www.amazon.com/Linux-Bible-Christopher-Negus/dp/1118999878/ref=sr_1_1?ie=UTF8&qid=1461254318&sr=8-1&keywords=the+linux+bible
If you want to start with a free resource:
BASH Programming - Introduction HOW-TO
BASH scripting is very effective, but once you've been writing those scripts for a while you'll want to move on to a programming language to maximize the benefits of automation.
Bash Scripting
I second this book. I have it and it's an awesome text.
Currently Working On: Python, OSCP Prep
Next Up: OSCP
Studying: Code Academy (Python), Bash Scripting, Virtual Hacking Lab Coursework
Luck is what happens when preparation meets opportunity
https://www.amazon.co.uk/Linux-Command-Shell-Scripting-Bible/dp/111898384X/ref=sr_1_1?ie=UTF8&qid=1461867433&sr=8-1&keywords=linux+shell+bible
Plus here is a whole series
https://www.youtube.com/watch?v=nVt3Rst-2H8&list=PL7B7FA4E693D8E790
lastly start with a simple project set a goal i.e I want to be able to backup a specific directory automatically. Get the basics laid out then take it a step forward add user interaction, then create a nice menu system with advanced features. next add the option to email the root account once backup is complete.
Create scenarios like the above and play
" Embrace, evolve, extinguish "
Luck is what happens when preparation meets opportunity
Glad to hear you're progressing well. If you have any questions or need any additional resources, just let us know.
There are a number of resources all over the internet, paid or not, that will help you learn bash. If you are like me, and have other scripting experience (I see you are MS and VMware certified, so perhaps you are comfortable with Powershell for example), then the learning curve isn't steep if you have very much familiarity with Linux.
Personally, I have gone through some of the basic syntax type things... single quotes vs double quotes vs tick marks, variable expansion, etc; noting the difference between bash and powershell. Then move on to conditional operations and loops and functions and do the same thing. I have **** sheets hanging at my desk that I have downloaded from various sources to help me if I forget the proper syntax (needing this less and less now) for a specific operation.
Finally, I being solving relevant problems with simple bash scripts. My project today is to remove the entries for a bunch of detached devices on 14 ESXi hosts that have been permanently deleted from the SAN. After about 30-45 minutes, I had a working script on my vMA VM that iterated through my list of hosts, targeted the host, parsed the output of an esxcli command to produce a list of permanently detached devices, and ran other familiar esxcli commands to do the rest of the work for me.
Much better than running the same command 476 times.
Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
Working on: RHCE/Ansible
Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...