Post Closed as "duplicate" by G-Man, drewbenn, Prvt_Yadv, DarkHeart, Stephen Harris of
3 applying code formatting
source | link

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

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

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

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
2 added 278 characters in body
source | link

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

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.

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

1
source | link

Bash: I have a variable in bash script;

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.