Bash Read Array from External File
- by jmituzas
I have setup a Bash menu script that also requires user input.
These inputs are wrote (appended to) a text file named var.txt like so:
input[0]='192.0.0.1'
input[1]='username'
input[2]='example.com'
input[3]='/home/newuser'
Now what I am trying to accomplish is to be able to read from var.txt from a script kinda like this:
useradd var.txt/${input[1]}
now I know that wont work just using it for an example.
Thanks in Advance,
Joe