I have a bash that reads as input a list of folder names (all numbers not letters) and tries to find the location of each. The Find command doesn't return anything to me at all. I do not know why. Whereas if I put the raw value without using a variable it works.
Code :
#!/bin/bash
filename='bat.txt'
n=1
while read line;
do
lien=$(find ./ -type d -name "$line")
# for read each line
echo "line no. $n : $line"
n=$((n+1))
done < $filename
Bat.txt sample :
19223
12233
34434
34434