My intention is to take the second line and look for the characters after the . delimiter. It works like this:
prompt> awk -F '.' 'FNR == 2 {print $NF}' file_name.txt
Sam
However, I wish to store that output in the variable, but its showing an error:
prompt> Name= $(awk -F '.' 'FNR == 2 {print $NF}' file_name.txt)
Sam: command not found
How do I fix that?