How can I generate a file that has a variable I want from several files

0

Hello very good I am new in programming and they sent me to make a script that starting from several generated files of an analysis (15645 to be specific) generate a file that contains the value "HA_RMSDm:" of those 15645 files the truth I am In 0 in programming I have to learn by force so I ask for your help if you can tell me if I'm ok or I'm probably very wrong but what I'm looking for is a script that analyzes 15645 files and then I generate a file with the value "$ HA_RMSDm:" of those 15645 files this is what I was doing can insult me no problem hehe but I am learning thanks for the help in advance and sorry for the spelling mistakes my keyboard has no tildes and it is 4 am and I do not advance . Porfa help

#!/bin/bash


#RSMDm
#Total_elapsep_time

#Loop over nohub
for i in (1...15645) do
        if i -r "$HA_RMSDm" then
                cat| grep "$HA_RMSDm" do
                        "$FinalRMSDm".in
        done
    
asked by yendrek velasquez 14.05.2018 в 07:58
source

1 answer

0

You could do a chain comparison, something like this:

#!/bin/bash
    string1='$HA_RMSDm'
    for i in (1...15645) do
        if [[ $string1 = *$HA_RMSDm* ]];
        then
            [LO QUE SEA]
        else
            [LO QUE SEA] //si lo necesitas
        fi
    
answered by 14.05.2018 в 09:15