#!/bin/bash

s="linux"
len=`expr length $s`
while [ -n "$s" ]
do
  echo "s : $s"
  if [ $len -ne 0 ]; then
    s=`echo $s | cut -c 1-$len`
    len=`expr $len - 1`
  else
    s=''
  fi
done
