Getting Command not found error Even though Script is working fine

Hi friends,

I am using below script to do some work. But even though script is working fine but while executing it i am getting command not found error. :frowning:

Here is the script :-

#!/bin/sh
Names="name.txt"
 
###main#####
  for LINE in `cat ${Names}`
        do
                Name=`echo $LINE |awk -F'|' '{print $1}'`
           `<some Command>:$Name`
     echo $Name is unlocked
   done
echo "Unlocking is done"

NOte:- its reading Names one by one from file and executing some commmnad. Functionality is working fine but i am not sure whey
"./script.sh: line 11: Unlocked: command not found" is coming.

Regards
Harpal Singh

#!/bin/sh
Names="name.txt"
 
###main#####
  while read LINE # preferable to use while loop to read files
        do
                     Name=`echo $LINE |awk -F'|' '{print $1}'`
    <some Command>
    echo "$Name is unlocked"
   done < $Names
echo "Unlocking is done"
1 Like

Run with option -x set and post log.

1 Like

Thanks Balajesuri for your help. But why my code was showing error? can you please explain a bit.?
I would like to add one more thing in my code which i have pasted eariler `<some Command>:$lableName` is `<some Command>:$Name`