Click here to Skip to main content
15,891,723 members
Articles / Programming Languages / Bash

Updating bash Variables in a Loop

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
8 Mar 2023CPOL1 min read 12.8K   3  
How to update a bash variable inside a loop when reading from command output
If you need to update a bash variable inside a loop, when taking input from another command, the syntax is not obvious. This tip shows how to correctly get input from the command and update bash variables correctly.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions