?
Solved

string search

Posted on 2013-01-15
2
Medium Priority
?
309 Views
Last Modified: 2013-01-16
Whats wrong in this code? Accepted a different but realized it wont fit my req. This was one
solution but even though ids are missing I get a blank email

cut -c 1-3 all.out > trailer.txt
while read $ID; do
 if ! grep -q ^$ID trailer.txt; then
   echo $ID not found
 fi ; done < ids.txt | mail -s "Missing ID(s)" mail@domain.com
ids.txt
trailer.txt
0
Comment
Question by:uco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 2000 total points
ID: 38780514
try
while read ID; do
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38780749
To find things out yourself (ozo's remark above is correct), try this next time:

sh -xv your_script.sh

this will run your script with verbose output so you'll be able to see what and where things go wrong.
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month13 days, 19 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question