Take the value of variable from a file and execute a command for each value

Hello Experts,

I would like to know the best way to assign a value to variable from a given file and execute a command including this variable for each entry from the file. to be more clear, i have a file with different lines (each line with a different value). i want to substitute the variable x with the value from each line and execute a command including this variable.

example:

#more listBSS1.log
1  -  UserLabel: TEST1
2  -  UserLabel: TEST2
#more listBSS1.log | awk -F" " '{print $1}'
1
2
3

I need to assign the values 1,2 & 3 to a variable X and execute the below command for each value.

#omcdo -cmd 'BSC_listBTS($X)'

Thanks in advance

See if this is working for you :

.... | awk ' { print "omcdo -cmd \047BSC_listBTS("$1")\047" | "sh" }  '

Hi

$ cat a
1  -  UserLabel: TEST1
2  -  UserLabel: TEST2


$ awk '{print "omcdo -cmd "q"BSC_listBTS("$1")"q;}' q="'" a |sh

Guru.