User Tools

Site Tools


journal:spring2019:bmather2:week11

unix week11


April 11, 2019

You can make arrays in bash with “declare” (-a makes a normal indexed array, while -A makes an associative array)

They work quite normally as compared to other languages.

When you call an array with a '*' or '@' as the index, it will expand the entire array (all of the values)

The “let” command allows you to do integer math in your variable assignments as well as use a var's old value in calculating its new value.
I.E. “let total=total+value”

But when non integers are concerned you need to echo the operation into “bc -lq” via a pipe

journal/spring2019/bmather2/week11.txt · Last modified: 2019/04/11 15:46 by bmather2