I have a variable in bash script dirs= "4"; I want to get this number from another file so I am using a command dirs= sed -n '1p' < test.txt; It gets me the number, I see it in the terminal. But Later in the code, I want to use a loop for dir in dirs.. it does not work because in the script it does not understand that dir is number.
d= sed -n '1p' < test.txt
for dirs in $d
do
echo "$dirs"
done
dirs= read $dirs
speeds= sed -n '2p' < test.txt
for speeds in $s
do
echo "$speeds"
done
for dir in $dirs
do
for speed in $speeds
do
echo "speed=$speed dir=$dir"
done
done