Solved

string search

Posted on 2013-01-15
2
301 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now