I am new to linux, and i have a shell script (.sh),i want to read file and execute a command depending on the information read.
This is the content of the test.sh
#/bin/sh
file="example.txt"
while IFS= read line
do
#$AIRBIN/display_airgen_cfg -m R -f $line.txt $line
done <"$file"
I concatenate ".txt" in the variable "$line" because I need it for run the command. The contents of the txt file are as follows
But when i execute get the following error:
NE mode is <R>.
.txt>. file is <prueba011
default delimiter is |.
and Dmode R and nespaceid = 3NE mode is <R>.ssname and neclassversion
for the NE prueba011
When I do a "sh -x test.sh" get the following:
file=example.txt
IFS=
+ read line
txt prueba011/bin/display_airgen_cfg -m R -f prueba011
NE mode is <R>.
.txt>. file is <prueba011
default delimiter is |.
and Dmode R and nespaceid = 3IFS=nceId,neclassname and neclassversion
for the NE prueba011
Tried to make different concatenations, but this still does not work