This question already has an answer here:
Bash script variable declaration - command not found
How to set a variable to the output from a command in Bash?
Spaces should be avoided.
out=$(wc -l < songs.txt)
it's easy first of all don't use space after and before equal sign
OUT=$(wc -l < songs.txt)
second for call it you can write something like this :