2

The problem is to read variables with read command dynamically from a read command in bash without knowing how many they are in advance and store them into an array .

I tested with :

read -p "array : " array[{0..#}]    

as

read -p "array : " array[{0..3}]

works

But with no success .

0

1 Answer 1

1

From the read usage output you can actually use the -a flag.

read -p "array: " -a array
2
  • you're right , how i miss that !!! ^^
    – Nico
    Nov 18, 2016 at 21:00
  • @Begoul I just updated my answer check again. Nov 18, 2016 at 21:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .