Reading File line by line - Issue

I am trying to read the below file line by line for the below operation
i) extract the directory alone and assign it one variable
ii) extract the permission available in the line and add comma between the permissions and assign to another variable
iii) Finally apply setfacl logic as shown in the output.

File - bkp_23.txt
*******************

# file:  /disk1/script_1/ user::rwx group::r-x group:service:r-x mask::r-x other::r-x
# file:  /disk1/script_1//hello.txt user::rw- group::r-- other::r--
# file:  /disk1/script_1//bkp_10.txt user::rwx group::r-x other::r-x

My Code :
**********

#!/bin/sh
input="bkp_23.txt"
while IFS= read -r line;
do
echo $line
file_name=`sed -e 's/# file:\(.*\)/\1/g' "$line" | awk '{print $1}'`
echo $file_name
file_perm=`sed -e 's/# file:\(.*\)/\1/g' "$line" | awk '{$1=""}{print}' | tr ' ' ',' | awk '{sub(",","")}1'`
echo $file_perm
echo "setfacl -m "$file_perm" "$file_name" executing"
done <"$input"

Output:
*********

setfacl -m user::rwx,group::r-x,group:service:r-x,mask::r-x,other::r-x  /disk1/script_1/
setfacl -m  user::rw-,group::r--,other::r--  /disk1/script_1//hello.txt
setfacl -m  user::rwx,group::r-x,other::r-x   /disk1/script_1//bkp_10.txt

But ending up with error :

sed: can't read # file: /disk1/script_1/ user::rwx group::r-x group:service:r-x mask::r-x other::r-x: No such file or directory

You want "$line" to be the input data for sed, not a file name.
Is this home work / course work?

yes i need to read each line from file and want to use each line as Input data.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.