0
while true
do
    seed=$RANDOM
    for dsn in ag uci nyt
    do
        for aug in eda bt 
        do
            python -u augf.py --dsn ${dsn} --samplecnt 32 --aug ${aug}  --gpu ${1} \
               > ${dsn}.${aug}.32.gpu${1}.$seed.log
        done
        for aug in cbert cgpt
        do
            envcbert/bin/python -u augf.py --dsn ${dsn} --samplecnt 32 --aug ${aug} --gpu ${1} \
             > ${dsn}.${aug}.32.gpu${1}.$seed.log
        done
        for genm in gpt ctrl
        do
            for nli in 0 1
            do
            python -u augf.py --dsn ${dsn} --samplecnt 32 --aug generate --nli_check ${nli} --genm ${genm} --gpu ${1}  \
                  > ${dsn}.generate.32.${genm}.nli${nli}.gpu${1}.$seed.log
            done
        done
    done
done

However, the output file, is

ag.eda.32.gpu0..log

where the seed is missing.

What's wrong with this and how to fix it ? Thanks.

yanachen
  • 3,401
  • 8
  • 32
  • 64

1 Answers1

2

What's wrong with this and how to fix it ?

#!/bin/bash

There are certain distros with certain (default) shells (diplomatically speaking) where $RANDOM means nothing, i.e., it is just yet another (implicitly empty) variable by default.

Andrej Podzimek
  • 2,409
  • 9
  • 12