DEV Community

Discussion on: The Shell Introduction I Wish I Had

Collapse
 
rpalo profile image
Ryan Palo

This is awesome! I love reading different people's approaches to teaching something to a beginner. I like that you took the time to explain what a shell is and why it's useful, because I didn't get that when someone showed me a shell for the first time and I wish I would have.

A couple gotchas to add for newbies:

  • When you're setting variables, make sure you don't have spaces on either side of the equals sign. my_var="Soup" is right, but my_var = "Soup" will cause errors. The bash shell uses spaces to separate commands from their arguments and split strings into lists, so doing it the second way will make it think you're trying to run the my_var command with first argument "=" and second argument "Soup".
  • I've read a couple of things including the Bash manual that say that, in general, using aliases should be avoided in preference to using functions pretty much always. That being said, there's no Bash police, so do what works for you, especially if you're not sharing your scripts with anybody.

Anyways, great post! Thanks again :)

Collapse
 
maxwell_dev profile image
Max Antonucci

Thanks for the feedback! Good point about the variable names, this article is a pretty broad overview so its no surprise I missed a few details like that. But they, I can always write a few follow-up pieces too.

I agree about it being good to explain why the Shell matters. I think that's actually the most important detail for me, since in the start when I researched it, there's no shortage of guides about how to use it. But until I really understood the why with the Pragmatic Programmer, I never saw why it mattered so much to stick through the learning process and bring that all back to my career. That's likely the part of the article I'd have wanted the most for my past self haha.

Collapse
 
rpalo profile image
Ryan Palo

Yep, and I think you definitely did a great job at that!