Need help in sftp basic commands

I'm trying to make use of some common generic functions already present in the scripts loaded in the environment.
A variable VAR1 is declared and used in the generic functions.
Its value is also set in the generic function.

Now I need to use that generic function for PURGING of some old files matching a pattern which are older than x days.
The suggested syntax is
find.. -name LDS-* -mtime +${VAR1} \
-exec ls -l {} \; >> ${LOG_PURGEFILE} 2>&1

But

  1. find command does not work in sftp environment.
  2. I need to declare VAR1=x, but I cant set the variables in a sftp session.
    CUZ Setting variables in an sftp session in not possible. They can only be set outside the sftp and referenced in it
    So pls advise how do I go about it..

Pls help ASAP..

if you could append a date stamp to the end of the files you can easily find and remove the files you need. I dont think your generic function will work in a ftp session.

Hi..
Thanks..
Can u pls elaborate how can I find and delete the files matching a particular pattern in sftp when I've suffixed the files with date.
I'm pretty new to unix and its actually a bad way to learn the way I'm doing..
Just copy pasting ..cuz of deadline..:frowning:
So pls help ..

Thanks in adv