JP Vossen on 29 Sep 2016 21:28:05 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] bash 4.4 news


On 09/20/2016 01:02 AM, Christopher Barry wrote:
The new bash has some cool options
http://git.savannah.gnu.org/cgit/bash.git/diff/NEWS?id=a0c0a00fc419b7bc08202a79134fcd5bc0427071&utm_source=anzwix

after installing it, do
man bash
then search for this:
/\ \ \ +Parameter\ +transformation

neat new variable manipulators, like
testarray=(this is my array)
echo ${testarray[@]@Q}
'this' 'is' 'my' 'array'

or
echo "${testarray[@]@A}"
declare -a testarray=([0]="this" [1]="is" [2]="my" [3]="array")

or
testvar="this\tis\tmy\tvar"
echo "${testvar2@E}"
this    is      my      var
or, echo without quotes
this is my var

plus readarray now allows any delimiter with -d now.

FYI, I finally got the bash 4.4 and readline 7.0 bits up in http://www.bashcookbook.com/bashinfo/...

Later,
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug