why does this simple program give such a weird output? The Next CEO of Stack OverflowSimple desktop program instantly closesWhy does this script work in the current directory but fail when placed in the path?Why does this bash script not work?Weird output by declare and arrayWhy I obtain this error when I try to perform this simple bash script?run bash script from another script and redirect its outputWhy does my terminal look like this?why this shell script program is not workingWhy does this cronjob not work?Why does Bash output / is a directory?

Chain wire methods together in Lightning Web Components

Is a distribution that is normal, but highly skewed considered Gaussian?

Do I need to write [sic] when a number is less than 10 but isn't written out?

How to write a definition with variants?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Is there a difference between "Fahrstuhl" and "Aufzug"

Which one is the true statement?

Writing differences on a blackboard

Grabbing quick drinks

Would a completely good Muggle be able to use a wand?

What is meant by "large scale tonal organization?"

RigExpert AA-35 - Interpreting The Information

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Does increasing your ability score affect your main stat?

Is micro rebar a better way to reinforce concrete than rebar?

Why isn't the Mueller report being released completely and unredacted?

How did people program for Consoles with multiple CPUs?

Prepend last line of stdin to entire stdin

Necessary condition on homology group for a set to be contractible

How I can get glyphs from a fraktur font and use them as identifiers?

Flying from Cape Town to England and return to another province

Legal workarounds for testamentary trust perceived as unfair

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Recycling old answers



why does this simple program give such a weird output?



The Next CEO of Stack OverflowSimple desktop program instantly closesWhy does this script work in the current directory but fail when placed in the path?Why does this bash script not work?Weird output by declare and arrayWhy I obtain this error when I try to perform this simple bash script?run bash script from another script and redirect its outputWhy does my terminal look like this?why this shell script program is not workingWhy does this cronjob not work?Why does Bash output / is a directory?










0















I've just started learning how to use arrays so sorry if the answer is somehow obvious. I made a simple program which i thought would just count normally. The output of this program ended up being not only backwards at first but very strange. the program is:



#!/bin/bash
num=1
declare -A A1
while true
do

A1[$(($num + 1))]=$num
num=$(( $num + 1 ))
e=0
for e in $A1[@]
do
echo $e
done
echo "e is $e"
echo "num is $num"
sleep 0.1
done


but it's output was started doing some really weird stuff after 8 as shown here:



1
e is 1
num is 2
2
1
e is 1
num is 3
3
2
1
e is 1
num is 4
4
3
2
1
e is 1
num is 5
5
4
3
2
1
e is 1
num is 6
6
5
4
3
2
1
e is 1
num is 7
7
6
5
4
3
2
1
e is 1
num is 8
8
7
6
5
4
3
2
1
e is 1
num is 9
8
7
6
5
4
3
2
1
9
e is 9
num is 10
8
7
6
5
4
3
2
1
9
10
e is 10
num is 11
8
7
6
5
4
3
2
1
11
9
10
e is 10
num is 12
8
7
6
5
4
3
2
1
11
12
9
10
e is 10
num is 13
8
7
6
5
4
3
2
1
11
12
9
10
13
e is 13
num is 14
8
7
6
5
4
3
2
1
11
12
9
10
13
14
e is 14
num is 15
8
7
6
5
4
3
2
1
11
12
9
10
15
13
14
e is 14
num is 16
8
7
6
5
4
3
2
1
11
12
9
10
15
16
13
14
e is 14
num is 17
8
7
6
5
4
3
2
1
17
11
12
9
10
15
16
13
14
e is 14
num is 18
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
e is 14
num is 19
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
19
e is 19
num is 20
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
20
19
e is 19
num is 21
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
21
20
19
e is 19
num is 22
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
22
21
20
19
e is 19
num is 23
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
23
22
21
20
19
e is 19
num is 24
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
24
23
22
21
20
19
e is 19
num is 25
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
25
24
23
22
21
20
19
e is 19
num is 26
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
e is 19
num is 27
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
27
e is 27
num is 28
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
e is 27
num is 29
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
29
e is 29
num is 30
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
29
30
e is 30
num is 31
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
29
30
31
e is 31
num is 32
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
29
30
31
32
e is 32
num is 33
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
29
30
31
32
e is 32
num is 34
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
29
30
31
32
e is 32
num is 35
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
35
29
30
31
32
e is 32
num is 36
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
35
36
29
30
31
32
e is 32
num is 37
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
35
36
29
30
31
32
37
e is 37
num is 38
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
35
36
29
30
31
32
37
38
e is 38
num is 39
39
8
7
6
5
4
3
2
1
17
18
11
12
9
10
15
16
13
14
26
25
24
23
22
21
20
19
28
27
33
34
35
36
29
30
31
32
37
38
e is 38
num is 40
^C


can anybody explain this?










share|improve this question




























    0















    I've just started learning how to use arrays so sorry if the answer is somehow obvious. I made a simple program which i thought would just count normally. The output of this program ended up being not only backwards at first but very strange. the program is:



    #!/bin/bash
    num=1
    declare -A A1
    while true
    do

    A1[$(($num + 1))]=$num
    num=$(( $num + 1 ))
    e=0
    for e in $A1[@]
    do
    echo $e
    done
    echo "e is $e"
    echo "num is $num"
    sleep 0.1
    done


    but it's output was started doing some really weird stuff after 8 as shown here:



    1
    e is 1
    num is 2
    2
    1
    e is 1
    num is 3
    3
    2
    1
    e is 1
    num is 4
    4
    3
    2
    1
    e is 1
    num is 5
    5
    4
    3
    2
    1
    e is 1
    num is 6
    6
    5
    4
    3
    2
    1
    e is 1
    num is 7
    7
    6
    5
    4
    3
    2
    1
    e is 1
    num is 8
    8
    7
    6
    5
    4
    3
    2
    1
    e is 1
    num is 9
    8
    7
    6
    5
    4
    3
    2
    1
    9
    e is 9
    num is 10
    8
    7
    6
    5
    4
    3
    2
    1
    9
    10
    e is 10
    num is 11
    8
    7
    6
    5
    4
    3
    2
    1
    11
    9
    10
    e is 10
    num is 12
    8
    7
    6
    5
    4
    3
    2
    1
    11
    12
    9
    10
    e is 10
    num is 13
    8
    7
    6
    5
    4
    3
    2
    1
    11
    12
    9
    10
    13
    e is 13
    num is 14
    8
    7
    6
    5
    4
    3
    2
    1
    11
    12
    9
    10
    13
    14
    e is 14
    num is 15
    8
    7
    6
    5
    4
    3
    2
    1
    11
    12
    9
    10
    15
    13
    14
    e is 14
    num is 16
    8
    7
    6
    5
    4
    3
    2
    1
    11
    12
    9
    10
    15
    16
    13
    14
    e is 14
    num is 17
    8
    7
    6
    5
    4
    3
    2
    1
    17
    11
    12
    9
    10
    15
    16
    13
    14
    e is 14
    num is 18
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    e is 14
    num is 19
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    19
    e is 19
    num is 20
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    20
    19
    e is 19
    num is 21
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    21
    20
    19
    e is 19
    num is 22
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    22
    21
    20
    19
    e is 19
    num is 23
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    23
    22
    21
    20
    19
    e is 19
    num is 24
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    24
    23
    22
    21
    20
    19
    e is 19
    num is 25
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    25
    24
    23
    22
    21
    20
    19
    e is 19
    num is 26
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    e is 19
    num is 27
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    27
    e is 27
    num is 28
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    e is 27
    num is 29
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    29
    e is 29
    num is 30
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    29
    30
    e is 30
    num is 31
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    29
    30
    31
    e is 31
    num is 32
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    29
    30
    31
    32
    e is 32
    num is 33
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    29
    30
    31
    32
    e is 32
    num is 34
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    29
    30
    31
    32
    e is 32
    num is 35
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    35
    29
    30
    31
    32
    e is 32
    num is 36
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    35
    36
    29
    30
    31
    32
    e is 32
    num is 37
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    35
    36
    29
    30
    31
    32
    37
    e is 37
    num is 38
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    35
    36
    29
    30
    31
    32
    37
    38
    e is 38
    num is 39
    39
    8
    7
    6
    5
    4
    3
    2
    1
    17
    18
    11
    12
    9
    10
    15
    16
    13
    14
    26
    25
    24
    23
    22
    21
    20
    19
    28
    27
    33
    34
    35
    36
    29
    30
    31
    32
    37
    38
    e is 38
    num is 40
    ^C


    can anybody explain this?










    share|improve this question


























      0












      0








      0








      I've just started learning how to use arrays so sorry if the answer is somehow obvious. I made a simple program which i thought would just count normally. The output of this program ended up being not only backwards at first but very strange. the program is:



      #!/bin/bash
      num=1
      declare -A A1
      while true
      do

      A1[$(($num + 1))]=$num
      num=$(( $num + 1 ))
      e=0
      for e in $A1[@]
      do
      echo $e
      done
      echo "e is $e"
      echo "num is $num"
      sleep 0.1
      done


      but it's output was started doing some really weird stuff after 8 as shown here:



      1
      e is 1
      num is 2
      2
      1
      e is 1
      num is 3
      3
      2
      1
      e is 1
      num is 4
      4
      3
      2
      1
      e is 1
      num is 5
      5
      4
      3
      2
      1
      e is 1
      num is 6
      6
      5
      4
      3
      2
      1
      e is 1
      num is 7
      7
      6
      5
      4
      3
      2
      1
      e is 1
      num is 8
      8
      7
      6
      5
      4
      3
      2
      1
      e is 1
      num is 9
      8
      7
      6
      5
      4
      3
      2
      1
      9
      e is 9
      num is 10
      8
      7
      6
      5
      4
      3
      2
      1
      9
      10
      e is 10
      num is 11
      8
      7
      6
      5
      4
      3
      2
      1
      11
      9
      10
      e is 10
      num is 12
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      e is 10
      num is 13
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      13
      e is 13
      num is 14
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      13
      14
      e is 14
      num is 15
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      15
      13
      14
      e is 14
      num is 16
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 17
      8
      7
      6
      5
      4
      3
      2
      1
      17
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 18
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 19
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      19
      e is 19
      num is 20
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      20
      19
      e is 19
      num is 21
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      21
      20
      19
      e is 19
      num is 22
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      22
      21
      20
      19
      e is 19
      num is 23
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      23
      22
      21
      20
      19
      e is 19
      num is 24
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      24
      23
      22
      21
      20
      19
      e is 19
      num is 25
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      25
      24
      23
      22
      21
      20
      19
      e is 19
      num is 26
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      e is 19
      num is 27
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      27
      e is 27
      num is 28
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      e is 27
      num is 29
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      e is 29
      num is 30
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      e is 30
      num is 31
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      31
      e is 31
      num is 32
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      31
      32
      e is 32
      num is 33
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      29
      30
      31
      32
      e is 32
      num is 34
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      29
      30
      31
      32
      e is 32
      num is 35
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      29
      30
      31
      32
      e is 32
      num is 36
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      e is 32
      num is 37
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      e is 37
      num is 38
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      38
      e is 38
      num is 39
      39
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      38
      e is 38
      num is 40
      ^C


      can anybody explain this?










      share|improve this question
















      I've just started learning how to use arrays so sorry if the answer is somehow obvious. I made a simple program which i thought would just count normally. The output of this program ended up being not only backwards at first but very strange. the program is:



      #!/bin/bash
      num=1
      declare -A A1
      while true
      do

      A1[$(($num + 1))]=$num
      num=$(( $num + 1 ))
      e=0
      for e in $A1[@]
      do
      echo $e
      done
      echo "e is $e"
      echo "num is $num"
      sleep 0.1
      done


      but it's output was started doing some really weird stuff after 8 as shown here:



      1
      e is 1
      num is 2
      2
      1
      e is 1
      num is 3
      3
      2
      1
      e is 1
      num is 4
      4
      3
      2
      1
      e is 1
      num is 5
      5
      4
      3
      2
      1
      e is 1
      num is 6
      6
      5
      4
      3
      2
      1
      e is 1
      num is 7
      7
      6
      5
      4
      3
      2
      1
      e is 1
      num is 8
      8
      7
      6
      5
      4
      3
      2
      1
      e is 1
      num is 9
      8
      7
      6
      5
      4
      3
      2
      1
      9
      e is 9
      num is 10
      8
      7
      6
      5
      4
      3
      2
      1
      9
      10
      e is 10
      num is 11
      8
      7
      6
      5
      4
      3
      2
      1
      11
      9
      10
      e is 10
      num is 12
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      e is 10
      num is 13
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      13
      e is 13
      num is 14
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      13
      14
      e is 14
      num is 15
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      15
      13
      14
      e is 14
      num is 16
      8
      7
      6
      5
      4
      3
      2
      1
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 17
      8
      7
      6
      5
      4
      3
      2
      1
      17
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 18
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      e is 14
      num is 19
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      19
      e is 19
      num is 20
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      20
      19
      e is 19
      num is 21
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      21
      20
      19
      e is 19
      num is 22
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      22
      21
      20
      19
      e is 19
      num is 23
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      23
      22
      21
      20
      19
      e is 19
      num is 24
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      24
      23
      22
      21
      20
      19
      e is 19
      num is 25
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      25
      24
      23
      22
      21
      20
      19
      e is 19
      num is 26
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      e is 19
      num is 27
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      27
      e is 27
      num is 28
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      e is 27
      num is 29
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      e is 29
      num is 30
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      e is 30
      num is 31
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      31
      e is 31
      num is 32
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      29
      30
      31
      32
      e is 32
      num is 33
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      29
      30
      31
      32
      e is 32
      num is 34
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      29
      30
      31
      32
      e is 32
      num is 35
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      29
      30
      31
      32
      e is 32
      num is 36
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      e is 32
      num is 37
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      e is 37
      num is 38
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      38
      e is 38
      num is 39
      39
      8
      7
      6
      5
      4
      3
      2
      1
      17
      18
      11
      12
      9
      10
      15
      16
      13
      14
      26
      25
      24
      23
      22
      21
      20
      19
      28
      27
      33
      34
      35
      36
      29
      30
      31
      32
      37
      38
      e is 38
      num is 40
      ^C


      can anybody explain this?







      command-line bash scripts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago







      TheRedStormer

















      asked 12 mins ago









      TheRedStormerTheRedStormer

      62




      62




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130065%2fwhy-does-this-simple-program-give-such-a-weird-output%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1130065%2fwhy-does-this-simple-program-give-such-a-weird-output%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

          Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

          Antonio De Lisio Carrera Referencias Menú de navegación«Caracas: evolución relacional multipleja»«Cuando los gobiernos subestiman a las localidades: L a Iniciativa para la Integración de la Infraestructura Regional Suramericana (IIRSA) en la frontera Colombo-Venezolana»«Maestría en Planificación Integral del Ambiente»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»«Conózcanos»«Caracas: evolución relacional multipleja»«La Metrópoli Caraqueña: Expansión Simplificadora o Articulación Diversificante»