Bash Scripts — Part 6 — Functions and Library Development

Mikhail Raevskiy
The Startup
Published in
10 min readJul 29, 2020

--

While developing bash scripts, sooner or later you will come across the fact that you periodically have to use the same code fragments. Typing them by hand is boring all the time, and copying and pasting is not our method. How to be? It would be nice to find a tool that allows you to write a block of code once and, when you need it again, just refer to it in the script. The bash shell provides this capability by allowing you to create functions. Bash functions are named blocks of code that can be reused in scripts.

--

--

Mikhail Raevskiy
The Startup

Bioinformatician at Oncobox Inc. (@oncobox). Research Associate