Computing.Net > Forums > Unix > ksh script

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.

ksh script

Reply to Message Icon

Name: Laura Leung
Date: March 3, 2005 at 04:56:32 Pacific
OS: win2000
CPU/Ram: ?
Comment:

Hello, I have a Ksh script problem. The scrip is polling a directory every 5 mins to get a file, which contains the input line like "put abc.dat /home/test" etc. If the file contain is not empty, the script have to check a predefine directory to found out how many file have
and then add the filename in the variable to pass another directory. I have some coding as the following:
while true
do
for Cname in $(ls /home/commend/)
do
if test -f $Cname ; then
echo "Processing $Cname..."

# read the content of command file
$read transfer-mode filename snodeid snode sourcedir destdir

if ($transfer-mode = "put")

# read the pre-define file directory
for fname in $(ls /home/file/)
do
if test -f $fname ; then
mv $fname $srcfile
else
echo "Handoff file not found!"
fi
done

#submit the process to another directory


fi
else
echo "File not found!"
fi
done
sleep 300
done



Sponsored Link
Ads by Google

Response Number 1
Name: gurubit
Date: March 3, 2005 at 06:01:06 Pacific
Reply:

Are you facing any problem with your script ?


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: ksh script

Need Help With KSH Script www.computing.net/answers/unix/need-help-with-ksh-script/6747.html

Test ssh connection from KSH script www.computing.net/answers/unix/test-ssh-connection-from-ksh-script/6950.html

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