Thanks for your reply. i tried that it is working fine.
Could you please help me, whether is it possible to add date&time stamp option in the below script.
for i in 'ls ../in '
do
mv ../in/$i ../prc/$i ---i want to add here --
done
Thanks
---------- Post updated 06-30-10 at 11:30 AM ---------- Previous update was 06-29-10 at 05:02 PM ----------
Hi Jim,
filetime()
{
perl -e '
$mtime = (stat("$ARGV[0]"))[9];
# time structure into variables
($sec,$min,$hr,$day,$mon,$yr,$wday,@dntcare) = localtime($mtime);
$yr = ($yr>=70) ? $yr+1900 : $yr+2000;
$yr=$yr%100;
$mon+=1;
printf ("%d%02d%02d-%02d-%02d-%02d", $yr,$mon,$day,$hr,$min, sec); ' "$1"
}
for i in *
do
newname=${i%%.}$(filetime $i).txt
mv $i ../prc/${newname}
done
------up to this am getting correct result----
cd ../prc
for i in *
do
echo $i
newname=${i%%.}$(filetime $i).txt
mv $i ../his/${newname}
done
---------am getting result like this-
file1100630-10-36-00100630-10-36-00.txt
file2100630-10-36-00100630-10-36-00.txt