Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
shell_dump_function [2019/10/24 22:01] rpjdayshell_dump_function [2019/10/24 23:44] (current) rpjday
Line 36: Line 36:
 </code> </code>
  
-Then:+First, it can dump regular variables:
  
 <code> <code>
-$ dump PATH HOME +$ dump HOME HISTFILE HISTSIZE
-PATH = /home/rpjday/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/rpjday/bin:/home/rpjday/go1.11.4/go/bin+
 HOME = /home/rpjday HOME = /home/rpjday
 +HISTFILE = /home/rpjday/.bash_history
 +HISTSIZE = 1000
 +$
 </code> </code>
  
-And arrays:+Next, dumping regular arrays:
  
 <code> <code>
-ARR=(fred barney wilma betty) +people=(fred barney wilma betty) 
-$ dump ARR +$ dump people 
-ARR = fred barney wilma betty+people = fred barney wilma betty 
 +
 +</code> 
 + 
 +Finally, dump a bash associative array: 
 + 
 +<code> 
 +$ declare -A wife 
 +$ wife[fred]=wilma 
 +$ wife[barney]=betty 
 +$ dump wife 
 +wife[fred] = wilma 
 +wife[barney] = betty
 $ $
 </code> </code>
  • shell_dump_function.1571954481.txt.gz
  • Last modified: 2019/10/24 22:01
  • by rpjday