LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 05-07-2021, 01:26 AM   #1
parveen.gupta.23091987
LQ Newbie
 
Registered: May 2021
Posts: 8

Rep: Reputation: Disabled
Question Reading from EndPointsPriority.txt and finding that file name in other Directory in .sh


EndPointsPriority.txt contains>>
0001105
0005074
0079557


Reading from EndPointsPriority.txt and finding that file name in other Directory in .sh


This is working >>>>>>>>>>>>

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 "*0001105*" 2>/dev/null)
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"

This is not working >>>>>>>>>>>>

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*" 2>/dev/null)
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"
 
Old 05-07-2021, 02:14 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
duplicate of https://www.linuxquestions.org/quest...ry-4175694834/
 
Old 05-07-2021, 06:05 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator Response

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of https://www.linuxquestions.org/quest...ry-4175694834/
 
  


Closed Thread

Tags
bash, shell



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Reading from EndPointsPriority.txt and finding that file name in other Directory parveen.gupta.23091987 Linux - Newbie 11 05-07-2021 05:26 AM
[SOLVED] read txt file into an array and make a second txt file zimbot Linux - General 12 09-05-2015 01:39 PM
Copy the contents of a txt file to other txt files (with similar names) by cp command Aquarius_Girl Linux - Newbie 7 07-03-2010 12:54 AM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration