神秘:Elif和Counter Increment Bug

时间:2015-08-02 04:49:23

标签: bash debugging conditional-statements

您好我正在尝试使用递增计数器运行for循环,该计数器会切换为elif语句。 for循环是一种构建一串音节以与macintalk合成的方法。我想每20毫秒添加一个短暂的沉默,但我似乎无法让它工作,我已经尝试了一堆调试步骤但似乎没有工作。有人能发现阻止elif被访问的错误吗?

编辑

好的所以我按照下面的建议并使用了-eq而不是=但我注意到计数器只重置一次并且不再次访问条件语句。修订后的代码发布在下面:

counter=0;
for k in $indx
do
    counter=$(($counter + 1));
    echo 'increment counter'
    echo $counter
    if [ $k -eq 0 ]
    then
        stream=$stream'@_'${syllarray[k]}
    elif [ $counter -eq 20 ]
    then
        echo Adding Silence after syllable: ${syllarray[k]}
        stream=$stream'_'${syllarray[k]}'[[ slnc 20 ]]'
        counter=0;
        echo 'reset counter'
        echo $counter
    else
        stream=$stream'_'${syllarray[k]}
    fi
done

示例输出:

使用预定词典,单词顺序和音韵合成音节流

参数:

声音 - 维多利亚

评分(字/分) - 120

音高调制间隔 - 0

基线间距 - 55

目录存在:)

为维多利亚打开音节转录

0

BIY

1

bUW

2

DAE

3

DOW

4

GOW

5

KUW

6

LAE

7

PAE

8

PIY

9

10

TIY

11

TUW

反平衡刺激指令(按字母顺序按音节索引)

11 2 9 8 4 6 0 5 10 11 2 9 8 4 6 1 3 7 8 4 6 0 5 10 11 2 9 1 3 7 0 5 8 8 4 6 1 3 7 0 5 10 8 4 6 11 2 9 0 5 10 1 3 7 8 4 6 11 2 9 1 3 7 11 2 9 0 5 10 1 3 7 8 4 6 0 5 10 11 2 9 8 4 6 1 3 7 0 5 10 8 4 6 11 2 9 0 5 10 8 4 6 11 2 9 0 5 10 1 3 7 8 4 6 1 3 7 0 5 10 11 2 9 1 3 7 8 4 6 0 5 10 1 3 7 11 2 9 1 3 7 11 2 9 1 3 7 0 5 10 8 4 6 1 3 7 0 5 10 11 2 9 0 5 10 11 2 9 8 4 6 11 2 9 1 3 7 8 4 6 0 5 10 1 3 7 11 2 9 8 4 6 0 5 10 8 4 6 1 3 7 11 2 9 0 5 10 1 3 7 8 4 6 11 2 9 8 4 6 1 3 7 11 2 9 0 5 10 8 4 6 11 2 9 0 5 10 8 4 6 11 2 9 1 3 7 0 5 10 1 3 7 8 4 6 0 5 10 1 3 7 0 5 10 11 2 9 1 3 7 11 2 9 8 4 6 0 5 10 11 2 9 8 4 6 1 3 7

使用正确的Macintalk格式创建平衡的刺激流字符串

增量计数器 1 增量计数器 2 增量计数器 3 增量计数器 4 增量计数器 五 增量计数器 6 增量计数器 7 增量计数器 8 增量计数器 9 增量计数器 10 增量计数器 11 增量计数器 12 增量计数器 13 增量计数器 14 增量计数器 15 增量计数器 16 增量计数器 17 增量计数器 18 增量计数器 19 增量计数器 20 在音节后添加沉默:gOW 重置计数器 0 增量计数器 1 .. [为清晰起见截断] .. 增量计数器 268

将流打印到屏幕

_tUW_dAE_rOW_pIY_gOW_lAE @ _bIY_kUW_tIY_tUW_dAE_rOW_pIY_gOW_lAE_bUW_dOW_pAE_pIY_gOW [[slnc 20]] _ LAE @ _bIY_kUW_tIY_tUW_dAE_rOW_bUW_dOW_pAE @ _bIY_kUW_tIY_pIY_gOW_lAE_bUW_dOW_pAE @ _bIY_kUW_tIY_pIY_gOW_lAE_tUW_dAE_rOW @ _bIY_kUW_tIY_bUW_dOW_pAE_pIY_gOW_lAE_tUW_dAE_rOW_bUW_dOW_pAE_tUW_dAE_rOW @ _bIY_kUW_tIY_bUW_dOW_pAE_pIY_gOW_lAE @ _bIY_kUW_tIY_tUW_dAE_rOW_pIY_gOW_lAE_bUW_dOW_pAE @ _bIY_kUW_tIY_pIY_gOW_lAE_tUW_dAE_rOW @ _bIY_kUW_tIY_pIY_gOW_lAE_tUW_dAE_rOW @ _bIY_kUW_tIY_bUW_dOW_pAE_pIY_gOW_lAE_bUW_dOW_pAE @ _bIY_kUW_tIY_tUW_dAE_rOW_bUW_dOW_pAE_pIY_gOW_lAE @ _bIY_kUW_tIY_bUW_dO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