Read file, send to dig, no output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Read file, send to dig, no output
# 1  
Old 04-27-2012
Read file, send to dig, no output

From the command line I am running the following command:

Code:
for i in $(awk '{print ($1)}' src-dst|uniq); do dig -x "$i" +short; done

src-dst has a list of IP addresses. When this script is running and I do a ps -ef | grep dig, I see the proper dig command with IP addresses being run, but the results do not display in stdout.
I tried redirecting dig with a > output and while output was created nothing was put in the file.

This works just fine for me:

Code:
i=8.8.8.8; dig -x "$i" +short

Result:
Code:
google-public-dns-a.google.com.


I hope this is enough information, any assistance would be appreciated.

Thank you for your time

Last edited by Scrutinizer; 04-27-2012 at 05:21 PM.. Reason: code tags
# 2  
Old 04-27-2012
Are you sure the IPs in the list resolve?
This User Gave Thanks to neutronscott For This Post:
# 3  
Old 04-27-2012
Thank you very much neutronscott. You are 100% right.

Sometimes it just takes making a fool of yourself to realize the obvious answer. I am on the wrong network and the addresses do not resolve where I am at.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Read a file and send mail based on grep

Hi All, I am having a job and I need to send email when the job is running. On any other case (success,fail) I don't needed to send email. I check with BMC they told they dont have that in the version I am using. So I created a dependent job and grepped for the status and sent email. My... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Shell Programming and Scripting

Read file data and send to different file

junk.txt has a single numerical value in it, let's say 50421.44. over.namelist has lots of expressions in it, but somewhere random it says value = x.x I need to go into junk.txt, pull out the number, and amend over.namelist to say value = 50421.44. :(:( I'm trying to use sed, but... (5 Replies)
Discussion started by: jammyjames
5 Replies

3. Shell Programming and Scripting

Read a file, add some text and send an email

Hi, If I am asking this question, you must have already figured out , that I am new to Unix, so here it goes I was trying to read a file, add some user defined content to it and send out an email , I did find out a way to achieve this, but looking at the code, it looks a bit crude to me, can... (3 Replies)
Discussion started by: karthikbhuvana
3 Replies

4. Shell Programming and Scripting

Read file and send email

I have a file like this. I need to ues this file to send emails to the appropriate ID/group. For instance in the first line - Subject should be --> "A1.csv - ABC" - Body should be --> File A1.csv has changed. - Email should be sent to A1@xyz.com,A3@xyz.com Lookup.csv: ... (1 Reply)
Discussion started by: vskr72
1 Replies

5. Shell Programming and Scripting

dig-x: only part of the output is needed

Hi everyone, how can I get the highlighted text only? I am only concerned with the first line of the "AUTHORITY SECTION" (in red). thank you in advance (4 Replies)
Discussion started by: Abdulelah
4 Replies

6. Shell Programming and Scripting

Read the lines within file and send each line to different new file

I need help.....I have number of data files and I need to read the contains of each file which is three lines by awk commands or script, and send each line within the data file to different new file . That means I will have three files as a result, the first file will contains the first lines for... (4 Replies)
Discussion started by: aldreho
4 Replies

7. Shell Programming and Scripting

Read a file with in UNIX and send multiple mails

Hi-I want to create a shell script which should read a file line by line (file having email address and transaction id of each user)and send email on email ids with the transaction id of the user respectively. Please help - I think a while loop should help but I am very new too UNIX Shell... (1 Reply)
Discussion started by: DeepSalwan
1 Replies

8. UNIX for Dummies Questions & Answers

Dig command output?

all, i am newbie to dns bind . Any help is very appreciated. I am using dig command to view the records in the config. I am expecting the following comamnds to display all the A (Address records) in the zone data file. my zone data file looks like this ------------------- $ORIGIN . $TTL... (2 Replies)
Discussion started by: sujathab
2 Replies

9. Shell Programming and Scripting

capture output of file and send last string thereof to new file

Hello, If I run a program from within shell, the output is displayed in the command line terminal. Is there a way I can capture that output and choose only the very last string in it to send it to a new file? Thank you (6 Replies)
Discussion started by: Lorna
6 Replies

10. Shell Programming and Scripting

Easiest way to send output to a debug file?

I have this in my script: DEBUG_DIR=/log/rotate_output DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP} SERVER_FILE_LIST="\ wasint0206 /logs/squid_backup wasint0201 /logs/squid_backup" /usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY do cd /log/squid_logs/${SERVER}... (2 Replies)
Discussion started by: LordJezo
2 Replies
Login or Register to Ask a Question