So, I'm trying to store a part of the name of a file into a variable for other uses. So, if my file was named hello123.txt and I want to store the 123 part. So I try
num= echo $file |cut -c6-8
But all it does is echo the 123 and not store that value in the variable. How do I make it so that it just initializes the variable and not do anything else?