#!/bin/ksh for i in /fatmen/fm* do typeset -u fatgrp fatpath=$i fatgrp=`basename $i` eval $fatgrp=$fatpath;export $fatgrp done