Unix read command (bash)

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
i'm working on a script that needs to read the variable $1, one character at a time and assign those characters to an array. i tried to use this line:
Code:
echo $1 | read -n 1 -a chars
however, everytime i try to read the variable $chars with echo ${chars
[*]}, it turns up empty.

please help.
 

quantum1

New Member
Messages
68
Reaction score
0
Points
0
Can you post the portion of script where you use the above command? Thanks.
 
Top