Linux bash for loop shell script example

Write a code using loops in Linux shell script to derive following pattern.

a Nix
b Craft
c Nix
d Craft
e Nix
f Craft

Try bash for loop as follows:

#!/bin/bash
c=0
var=""
for i in a b c d e f
do
        # find odd or even number
	rem=$(( $c % 2 ))
        # for every even number display "nix" else show "Craft" #
	[ $rem -eq 0 ] && var="nix" || var="Craft"
	echo "$i $var"
        # increase counter 
	(( c++ ))
done

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki