Solved

string search

Posted on 2013-01-15
2
303 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
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 38780514
try
while read ID; do
0
 
LVL 37

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

777 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