hpr3551 :: Bash snippet - some possibly helpful hints
Using 'eval', 'mapfile' and environment variables
Hosted by Dave Morriss on Monday, 2022-03-14 is flagged as Explicit and is released under a CC-BY-SA license.
Bash, eval, mapfile, environment variables.
2.
The show is available on the Internet Archive at: https://archive.org/details/hpr3551
Listen in ogg,
spx,
or mp3 format. Play now:
Duration: 00:24:35
Bash Scripting.
This is an open series in which Hacker Public Radio Listeners can share their Bash scripting knowledge and experience with the community. General programming topics and Bash commands are explored along with some tutorials for the complete novice.
Overview
I write a moderate number of Bash scripts these days. Bash is not a programming language as such, but it’s quite powerful in what it can do by itself, and with other tools it’s capable of many things.
I have enjoyed writing such scripts for many years on a variety of hardware and operating systems, and Bash is my favourite - partly because Linux itself is so flexible.
This is just a short show describing three things I tend to do in Bash scripts to assist with some tasks I find I need to undertake.
- Generate Bash variables from a text file - usually output from a program
- Fill Bash arrays with data from a file or other source
- Use environment variables to control the Bash script’s execution
Long notes
Follow this link to read the detailed notes associated with this episode.
Links
- Various links:
- Previous episodes in this series about arrays: