Bash script is not working on many files by using for loop

后端 未结 2 621
北海茫月
北海茫月 2021-01-26 11:54

This is my script:

#!/bin/bash
SOL_atom_index=116101
number=1
SOL_mol_index=SOL$number
index=1
for index in {1..100}
do
    for SOL_index in {116101..136845}
            


        
相关标签:
2条回答
  • Use ls with wildcard eg:

    for eqfile in `ls -l /*.ndx`
       do
         sed -i "s/$SOL_atom_index/$SOL_mol_index/g;s/$(($SOL_atom_index+1))/$SOL_mol_index/g;s/$(($SOL_atom_index+2))/$SOL_mol_index/g" $eqfile 
       done
    
    0 讨论(0)
  • 2021-01-26 12:58

    It's not working. I have only numbers and they dont change to SOL, I dont know why

    0 讨论(0)
提交回复
热议问题