Bash Tips - 15
Pitfalls for the unwary Bash loop user
This is the fifteenth episode covering useful tips for Bash users. In the last episode we looked at the
'for' loop, and prior to that we looked at
'until' loops. In this one I want to look at some of the loop-related issues that can trip up the unwary user.
Loops in Bash are extremely useful, and they are not at all difficult to use in their basic forms. However, there are some perhaps less than obvious issues that can result in unexpected behaviour.
I have provided detailed notes as usual for this episode, and these can be viewed here.
- “GNU BASH Reference Manual”
- Previous episodes under the heading Bash Tips:
- HPR episode 1648 “Bash parameter manipulation”
- HPR episode 1843 “Some Bash tips”
- HPR episode 1884 “Some more Bash tips”
- HPR episode 1903 “Some further Bash tips”
- HPR episode 1951 “Some additional Bash tips”
- HPR episode 2045 “Some other Bash tips”
- HPR episode 2278 “Some supplementary Bash tips”
- HPR episode 2293 “More supplementary Bash tips”
- HPR episode 2639 “Some ancillary Bash tips - 9”
- HPR episode 2649 “More ancillary Bash tips - 10”
- HPR episode 2659 “Further ancillary Bash tips - 11”
- HPR episode 2669 “Additional ancillary Bash tips - 12”
- HPR episode 2679 “Extra ancillary Bash tips - 13”
- HPR episode 2689 “Bash Tips - 14”