Hello guys
I want to retrieve two data from a file, like this:
bash-2.03$ cat numtest
123456
123457
bash-2.03$ more ./test_num
#!/bin/bash
num1=
num2=
cnt=1
while read x
do
num${cnt}=$x
cnt=$(($cnt+1))
done <$1
echo $num1 "\n" $num2
But when i executed this script, error popped up
bash-2.03$ ./test_num numtest
./test_num: num1=123456: command not found
./test_num: num2=123457: command not found
\n
Can anyone give any suggestion? Thank you.