I have two filenames that I would like to store in a Bash variable :
For this, I did :
$ b=$(ls Fisher_GCph_WL_XSAF_COLUMN*PESS_F*gamma_*)
I get the variable b
equal to :
$ echo $b
Fisher_GCph_WL_XSAF_COLUMN2_2_PESS_F_FoM_33.22_gamma_0.071.txt
Fisher_GCph_WL_XSAF_COLUMN2_2_PESS_F_FoM_71.91_gamma_N.txt
I want to build an array of 2 elements containing the 2 filenames above.
I tried to access them by :
$d eclare -a b
$ echo ${b[0]}
returns nothing
and
$ echo ${b[1]}
returns F
What to do to have an array of string where I could access directly to first or second filename by index 0
or 1
?