I am collecting data to one file with below script
while IFS= read -r line
do
echo "$line"
echo -e "$line-new" >>newfile.txt
done <"file.txt
"
new file has below data
gl-system-events_1
gl-events_2
gl-system-events_0
gl-events_6
gl-events_1
gl-events_5
gl-system-events_6
gl-system-events_4
gl-events_3
gl-system-events_2
gl-system-events_5
gl-events_0
now I want to write script that will read each line in sequence and run specific command for that string
for example if its identify work gl-system-events_2 it should run command A, if its identify gl-events_0 it should run command B, if its identify something else it should run command C
can you help me how I can use if or any other method to archive this.
Regards, SAM