how to remove the path

Hi,
I have a variable i; I want variable j to be derived from variable i

for ex:
i=/home/mbsprod/agency/hyb_agg_file.pl
then j should be
j=hyb_agg_file.pl

how to do this ?

Thanks,
Ram.

j="`perl /home/mbsprod/agency/hyb_agg_file.pl`"
i=/home/mbsprod/agency/hyb_agg_file.pl

j=${i##*/}
i=/home/mbsprod/agency/hyb_agg_file.pl

j=`basename $i`

I have a page full of scripts; the scripts are in various folders; I want to copy each script to a destination folder:

here is my script:

for i in `cat filename`
do
cp $i $destfold/$j
done

Example of my filename:

/home/mbsprod/bin/pool_update_fac_dat.pl
/home/mbsprod/bin/update_knob_file.pl
/home/MtgMdlApps/hybidx/bin/create_ramp_file.pl
/home/MtgMdlApps/hybidx/bin/patch_rtn_univ.pl
/home/MtgMdlApps/POOLS/InfoAtOrigDate/bin/bd_date_check.pl

I want my output to be :

$destfold/pool_update_fac_dat.pl
$destfold/update_knob_file.pl
$destfold/create_ramp_file.pl
$destfold/patch_rtn_univ.pl
$destfold/bd_date_check.pl
while read i
do
  j=${i##*/}  
  cp $i $destfold/$j
done < filename
echo $i | awk -F'/' '{print $NF}'

will show the last field

j=`echo $i | awk -F'/' '{print $NF}'`

will store last field to variable j