Shell script “for” loop syntax

Brace expansion, {x..y} is performed before other expansions, so you cannot use that for variable length sequences. Instead, use the seq 2 $max method as user mob stated. So, for your example it would be: max=10 for i in `seq 2 $max` do echo “$i” done

Returning function pointer type

int (*getFunc())(int, int) { … } That provides the declaration you requested. Additionally, as ola1olsson notes, it would be good to insert void: int (*getFunc(void))(int, int) { … } This says that getFunc may not take any parameters, which can help avoid errors such as somebody inadvertently writing getFunc(x, y) instead of getFunc()(x, y).