Computing.Net > Forums > Unix > script need help

script need help

Reply to Message Icon

Original Message
Name: Tomba
Date: May 5, 2005 at 04:28:01 Pacific
Subject: script need help
OS: AIX
CPU/Ram: 128
Comment:

Hi,

How can i check for .txt file in a directory and find out the biggest file among them and then append the rest ones in that big file at any time and move that file somewhere. At the maximum we can expect 5 .txt files in that directory. those files comes as an ftp.
Please help..

Thanks in advance.

Regards,
Tomba


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: May 5, 2005 at 04:46:09 Pacific
Subject: script need help
Reply: (edit)

if [ -s filename.txt ] ; then
echo "FILE EXISTS"
fi

BIGFILE=`ls -s /dir | sort -nr | head -1`

man test
man ls
man cat


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: script need help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software