#!/bin/ksh fun_now () { export s_now=`date +'%Y%m%d%H%M%S'` } fun_now echo ${s_now} sleep 3 fun_now echo ${s_now} exit