So I am trying to read each line of a file but it gives me an error.
No such file or directory
But the file does exist
here is the code:
echo the file path is $pathToGo
while read p
do
echo $p
done < $pathToGo
output:
Now if I hard code the path it works just fine:
pathToGo="C:\Users\sorel\Bash\CW3\4\files\indexFiles\3346"
echo the file path is $pathToGo
while read p
do
echo $p
done < $pathToGo
I have also tried this code on a Linux machine, with a different path, and the same error is showing...
any help would be much appreciated.