Quote:
Originally Posted by shruggy
Ensure the variable $eP contains the correct value at that point in script execution. I see you echoing it just before. Does it print what you expect?
You may also temporarily remove the 2>/dev/null redirection in the find command to see if there are any error messages.
|
>>>>>>
echo "Start"
ePFileName='../resources/EndPointsPriority.txt'
counteP=1
while IFS= read -r eP; do
# reading each line
echo "Line No. $counteP : ${eP}"
#issue on below line
for file in $(find /apps_01/CBK/T5G2Batch/dataTqr/ -iname "*${eP}*")
do
# if file does not exist, don't try to send it
[ -f "$file" ]||continue
echo "File found $file"
done
counteP=$( expr $counteP + 1 )
echo "new count $counteP"
done < $ePFileName
echo "End"
>>>Output
Start
Line No. 1 : 0001105
new count 2
Line No. 2 : 0005074
new count 3
Line No. 3 : 0079557
new count 4
End
One more thing i observer
echo "Start"
ePFileName='../resources/EndPointsPriority.txt'
counteP=1
while IFS= read -r eP; do
# reading each line
echo "Line No. $counteP : ${eP} test"
#issue on below line
for file in $(find /apps_01/CBK/T5G2Batch/dataTqr/ -iname "*${eP}*")
do
# if file does not exist, don't try to send it
[ -f "$file" ]||continue
echo "File found $file"
done
counteP=$( expr $counteP + 1 )
echo "new count $counteP"
done < $ePFileName
echo "End"
output changes to ( this is not correct)
Start
testNo. 1 : 0001105
new count 2
testNo. 2 : 0005074
new count 3
testNo. 3 : 0079557
new count 4
End