I am trying to read out a line from a file with sed.
a=0
atoms=$(sed -n '6p' < "POSCAR_""$a")
echo $atoms
This gives the following error: : no such file or directory
I know the file exists because when I try the same command with the manually written file name it gives the correct output.
I think the problem lies in the way I input the file with a variable and a prefix, but I cannot find any solution to this problem.
Wanted output: K Nb O Which is the sixth line in the file POSCAR_0.