I write a code in Bash script and the Linux does not run it correctly and printed character instead of character’s value.
Can anyone help me?
I write a code in Bash script and the Linux does not run it correctly and printed character instead of character’s value.
Can anyone help me?
 
    
     
    
    Aside from the confusion between backtick and ', you are also over-using the sub-shell syntax. You do not need to use echo $(cat $LOOP). You can just run cat $LOOP directly.
#!/bin/bash
for FILE in $(ls); do
  echo "Here is ${file}:"
  cat ${FILE}
  echo ""
done
A couple of points of style as well:
FILE is more descriptive than LOOP.${ ... } instead of just prefixing them with $. In simple scripts like this, it does not make a difference, but when your scripts get more complicated, you can get into trouble when you do not clearly delineate variable names.