Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| shell_dump_function [2019/10/24 22:01] – rpjday | shell_dump_function [2019/10/24 23:44] (current) – rpjday | ||
|---|---|---|---|
| Line 36: | Line 36: | ||
| </ | </ | ||
| - | Then: | + | First, it can dump regular variables: |
| < | < | ||
| - | $ dump PATH HOME | + | $ dump HOME HISTFILE HISTSIZE |
| - | PATH = / | + | |
| HOME = / | HOME = / | ||
| + | HISTFILE = / | ||
| + | HISTSIZE = 1000 | ||
| + | $ | ||
| </ | </ | ||
| - | And arrays: | + | Next, dumping regular |
| < | < | ||
| - | $ ARR=(fred barney wilma betty) | + | $ people=(fred barney wilma betty) |
| - | $ dump ARR | + | $ dump people |
| - | ARR = fred barney wilma betty | + | people |
| + | $ | ||
| + | </ | ||
| + | |||
| + | Finally, dump a bash associative array: | ||
| + | |||
| + | < | ||
| + | $ declare -A wife | ||
| + | $ wife[fred]=wilma | ||
| + | $ wife[barney]=betty | ||
| + | $ dump wife | ||
| + | wife[fred] = wilma | ||
| + | wife[barney] = betty | ||
| $ | $ | ||
| </ | </ | ||