This is how the script gets started over the terminal:
echo 'username1 username2 username3' | ./security_check.sh
This is the part of the program which should read the stdin and put it into an array:
while read -r line_input
do
i_users[i]=$line_input
i+=1
done
IFS
is not set to something different in this script.
After the input is saved in an array it should be able to get printed like this:
for i in ${i_users[@]}
do
echo "$i"
done
This script takes the whole input through stdin and puts it just in i_users[0]
.
How can I fix this? The array i_users
was declared with declare -a i_users
at the beginning of the script