最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

root - save results of iterated simulation with bash - Stack Overflow

programmeradmin1浏览0评论

I'm new to bash. i'm trying to use a bash script to run another bash script in an automated way. the other bash script is running simulations which i want to be able to do for many values (i have two for loops). i also want to save the results of the simulations after each iteration of the loop and i don't know how to do that in bash. results are produced by root software (from CERN) in a .txt file and i don't know how to access the values inside. thanks in advance to anyone who can suggest something:)

i tried something like this:

ENERGY_FILE="/my_path/energy_values.txt"

while IFS= read -r ENERGY
do
    
    for INPUT in {500..10000..1000}
    do
        
        echo "Executing $TARGET_SCRIPT with Energy: $ENERGY and Input: $INPUT"
        bash "$TARGET_SCRIPT" "$ENERGY" "$INPUT"
        
        dir_name="output_${INPUT}_${ENERGY}"
        mkdir -p "$dir_name" 
    done
done < "$ENERGY_FILE"

发布评论

评论列表(0)

  1. 暂无评论