Hi all,
I am planned to delete a sequential file after run a job.But my shell script have problem.The problem is like this:
I pass the sequential file name as parameter to shell script. the shell script will read a text file which the text file name is the sequential file name and the other files' path which also will be deleted.
But the problem is : It will failed in case the text file only contain 1 line of input .It need 2nd line even it is blank. The script is write like this:
exec < $textfilename
while read LINE;
do
<capture the file name and path and delete the file>
done
Any ideas?how to set detect EOF? any web site recommend to me?I know here is forum for DataStage .But please help me on this. Thanks.
shell script problem.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 82
- Joined: Thu Dec 02, 2004 10:27 pm
- Location: INDIA
Please try this
Thanks
Code: Select all
#!/bin/ksh
FILENAMELIST=$1
PROG=`basename $0`
while read FILENAME discard
do
echo "Deleting $FILENAME"
rm -f $FILENAME
done < $FILENAMELIST
~
dsxuserrio
Kannan.N
Bangalore,INDIA
Kannan.N
Bangalore,INDIA