On Mon, Oct 18, 2010 at 2:10 AM, Siddhesh Poyarekar < siddhesh.poyare...@gmail.com> wrote:
> You're basically looking to replace the oldest file at all times, > kinda like log rotation, so you can simply follow the logic: > > n=$(ls -1|wc -l) > lf n < 5 then > create the n+1th file > else > replace the file you get with ls -1t|tail -1 > end if > > Thank you again. But, if I call the variable as "n", the whole name of the file becomes *n. * **I have given my total script below which will get the file, immediate previous one of latest one. Then, a command will be applied on that... and after that, the new modified file will be saved in a new directory. * * *cd /home/mohib/Desktop/Raw/* *n=$(ls -1t|head -2|tail -1)* */opt/gpac/bin/gcc/MP4Box -hint -latm "n"* *cp "n" /home/mohib/Desktop/Final/* * * *n=$(ls -1|wc -l)* *lf n < 5 then* * create the n+1th file* *else* * replace the file you get with ls -1t|tail -1* *end if* Whats wrong I have made here? -- Best, Zico _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc