i've been trying to get something like this to work for a while now but I keep running into little imperfection that mess up building my array.
#!/bin/bashThere are a total of four lines in this repo file
repofile=~/Home/Documents/repoKali
I type this into the command line
wc -l < $repofile
I get the following output
6
But when I type this
SIZE=$(wc -l < "$repofile")
I get this
6: command not found
I'm trying build an array that is as big as the number of lines in $repofile. I'm not sure why the commands work outside of variable assignment and not when I assign them to SIZE. I mean the output changes! or am I just missing something?
Please Help. I'm trying to do something like this.
readarray -s $SIZE < $repofile