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
Solved

string search

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
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é.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

829 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