tomocafe / bash-boost

bash-boost is a set of library functions for bash, useful for both scripting and interactive use. It draws inspiration from the Boost C++ libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unpack list into named variables

tomocafe opened this issue · comments

bb_unpack LISTVAR var1 var2 ...

would set var1=${LISTVAR[0]}, etc.

Stop assigning once the list is empty.

Similar, bb_rename ITEM1 ITEM2 ... var1 var2 ... to set var1=ITEM1, etc.

Useful so you can do this in a function: bb_rename "$@" foo bar