Computing.Net > Forums > Unix > script need help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

script need help

Reply to Message Icon

Name: Tomba
Date: May 5, 2005 at 04:28:01 Pacific
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



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: May 5, 2005 at 04:46:09 Pacific
Reply:

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

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

man test
man ls
man cat


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: script need help

KSH Script-Need Help www.computing.net/answers/unix/ksh-scriptneed-help/5534.html

About Shell script - Need help www.computing.net/answers/unix/about-shell-script-need-help-/5796.html

Need help with sorting a file www.computing.net/answers/unix/need-help-with-sorting-a-file/6971.html