I am using RedHat (rhelsvrbase64-6.2) version. I have written an incron job to convert a file(i.e. in utf-16le format) to UTF-8 Format.
When i am running my job, It is creating multiple UTF-8 copies of my file.
My incrontab script is as follows:
**/home/sap/SRMArchive/incronTest IN_CLOSE_WRITE /usr/local/bin/test.sh $@ $#**
test.sh
**#!/bin/bash
echo "hi">>/var/log/my.log
echo $1>>/var/log/my.log
echo $2>>/var/log/my.log
file -bi $1/$2 >>/var/log/my.log
iconv -f utf-16le -t UTF-8 $1/$2 > $1/UTF8_$2**
When i am dropping any file to my '/home/sap/SRMArchive/incronTest' folder, The output i am getting is number of files named as follows :
UTF8_myFile.txt
UTF8_UTF8_myFile.txt
UTF8_UTF8_UTF8_myFile.txt
UTF8_UTF8_UTF8_UTF8_myFile.txt
.........
........
Thanks in advance