Relative Content

Tag Archive for stringbashfunctionshelleval

BASH: reading a text file and using each line as an input for a function

I have a file in which there are more than thousand lines and in each line there is a string of 12 characters. I also have a script in which there is a function. I want the file to be read every time the function is executed and the first 8 characters of each line of this file will be received as input and the function will be executed for each line of the file.
I’d checked similar topics but they didn’t help me. I don’t have the possibility to use Python, Jason and other languages ​​and libraries except shell script.
The script I wrote is as follows, which seems to work correctly, but returns an error: