Computing.Net > Forums > Unix > ksh script

ksh script

Reply to Message Icon

Original Message
Name: Laura Leung
Date: March 3, 2005 at 04:56:32 Pacific
Subject: ksh script
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


Report Offensive Message For Removal


Response Number 1
Name: gurubit
Date: March 3, 2005 at 06:01:06 Pacific
Subject: ksh script
Reply: (edit)

Are you facing any problem with your script ?


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

Comments:

 


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




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge