#! /bin/csh
set umr=UMR
foreach i ( `ls`)
set file_nm=$i
set bh_nm=`echo $file_nm | cut -d"_" -f2`
if($bh_nm !=$umr) then
{
set bh_ext=`echo $file_nm | cut -d"_" -f4`
set bh_num_nm="$bh_nm $bh_ext a .txt"
mv $file_nm $bh_num_nm
}
else
if ($bh_nm ==$umr) then
{
set um_ext=`echo $file_nm | cut -d"_" -f5`
if ($um_ext=="1.txt") then set um_ext_new=1
else
if ($um_ext=="2.txt") then set um_ext_new=2
endif
set umr_bh=`echo $file_nm | cut -d"_" -f3`
set umr_nm= "$umr_bh $um_ext_new b .txt"
mv $file_nm $umr_nm
}
endif
end
why i always got the error:
Code:
if: Expression syntax error?
Thanks so lot.