Categories
Linux Tutorial Series

Linux Tutorial Series – 179 – Shell scripts – when and when not to use them

Here is the video version, if you prefer it:

Shell scripts ought to be used for automating tasks and file management. That was an assertion made by (Ward, 2014) and I agree with that.

If you ever need to do something more than manipulate files or automate tasks, shell scripts probably aren’t the ideal choice for it. I used shell scripts for the following tasks:

  • seeing a difference between multiple files in two folders
  • automating a task of starting a program

If I were to use shell scripts for some kind of text manipulation or some calculations, I would use a different programming language. It’s not that shell scripts can’t do calculations or manipulate text, it is that it is easier to do so in other programming languages. So keep in mind: If it is not file management or automation, use another programming language. Pick the right tool for the right task.

Hope you learned something useful!

References

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Page 250

Categories
Linux Tutorial Series

Linux Tutorial Series – 178 – What are shell scripts?

Here is the video version, if you prefer it:

Shell scripts are commands written in a file. (Ward, 2014)⁠ If you were to look at a shell script file, it would be composed of commands. Not everything would be a command though, but you would recognize commands.

So in a sense, we aren’t learning nothing new, but we will learn some things which appear in shell scripts and don’t appear outside them.

Talk soon!

References

Ward, B. (2014). How Linux Works: What Every Superuser Should Know (2nd ed.). No Starch Press. Page 249