Can't figure out why this repeats


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Can't figure out why this repeats
Prev   Next
# 1  
Old 07-24-2012
Can't figure out why this repeats

Code:
#!/bin/sh
while IFS=: read address port; do
        : ${port:=443}
        address=$address
        port=$port
        
        cd $f_location
        
        number=`grep "$address" thing.txt -A 1 | grep "addresses=" | cut -d'"' -f2`

        echo "$address,$port,$number,$answer" >> /var/tmp/results.txt | tee -a $log

done < address.txt

Now when that is run the script loops a couple of times and then exits. Why would it repeat?

My address.txt only has stuff written like this:
Code:
www.google.com:80
www.gmail.com:8080
www.amazon.com:443
www.msn.com
www.hotmail.com
www.unix.com

 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash to rename files repeats previous filename in directory

In the below bash processes substitution, if there are 3 files in a directory /home/cmccabe/medex.logs/analysis.log, the filename variable is set to where these files are located. The code does execute, the problem is that if there is a renamed file in the output directory below, it gets... (0 Replies)
Discussion started by: cmccabe
0 Replies

2. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies

3. Shell Programming and Scripting

Searching a large file for short tandem repeats

Hello, I am searching large (~25gb) DNA sequence data in fasta short read format: >ReadName ACGTACGTACGT... for short tandem repeats, meaning instances of any 2-6 character based run that are repeated in tandem a number of times given as an input variable. Seems like a reasonably simple... (3 Replies)
Discussion started by: ljk
3 Replies

4. Shell Programming and Scripting

Remove brackets repeats and separate in columns

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (4 Replies)
Discussion started by: manigrover
4 Replies

5. Shell Programming and Scripting

sed behaving oddly, repeats lines

Hi, all. Here's the problem: sed '/FOO/,/BAR/p' That should print anything between FOO and BAR, right? Well, let's say I have file.txt that contains just one line "how are you today?". Then I run something like the above and get: $ sed '/how/,/today/p' file.txt how are you... (9 Replies)
Discussion started by: pereyrax
9 Replies

6. UNIX for Dummies Questions & Answers

awk repeats counter

if I wanted to know if the word DOG(followed by several random numbers) appears in col 1, how many times will that same word DOG* appeared in col 2? This is a very large file Thanks! (7 Replies)
Discussion started by: verse123
7 Replies

7. Shell Programming and Scripting

Cant figure out this..

Hi, I need a little help here. I am exporting user info from a PSQL database and everything is working with the exception of this: 10029008:dsAuthMethodStandard\:dsAuthClearText:classword:10029008:2004:10029008:10029008:/home/student/1002/90/08:10029008 It is putting a colon right before the... (1 Reply)
Discussion started by: Stud33
1 Replies

8. UNIX for Dummies Questions & Answers

Search for repeats in text file - how?

I have a text file that I want to search for repeated lines and print those lines. These would be lines in the file that appear more than once. Is there a way to do this? Thanks (4 Replies)
Discussion started by: aarondesk
4 Replies
Login or Register to Ask a Question
inb(9F) 						   Kernel Functions for Drivers 						   inb(9F)

NAME
inb, inw, inl, repinsb, repinsw, repinsd - read from an I/O port SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> unsigned char inb(int port); unsigned short inw(int port); unsigned long inl(int port); void repinsb(int port, unsigned char *addr, int count); void repinsw(int port, unsigned short *addr, int count); void repinsd(int port, unsigned long *addr, int count); INTERFACE LEVEL
The functions described here are obsolete. For the inb(), inw(), and inl() functions, use, respectively, ddi_get8(9F), ddi_get8(9F), and ddi_get8(9F) instead. For repinsb(), repinsw(), andrepinsl(), use, respectively, ddi_rep_get8(9F), ddi_rep_get8(9F), and ddi_rep_get8(9F) instead. PARAMETERS
port A valid I/O port address. addr The address of a buffer where the values will be stored. count The number of values to be read from the I/O port. DESCRIPTION
These routines read data of various sizes from the I/O port with the address specified by port. The inb(), inw(), and inl() functions read 8 bits, 16 bits, and 32 bits of data respectively, returning the resulting values. The repinsb(), repinsw(), and repinsd() functions read multiple 8-bit, 16-bit, and 32-bit values, respectively. count specifies the number of values to be read. A pointer to a buffer will receive the input data; the buffer must be long enough to hold count values of the requested size. RETURN VALUES
The inb(), inw(), and inl() functions return the value that was read from the I/O port. CONTEXT
These functions may be called from user, interrupt, or kernel context. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |x86 | +-----------------------------+-----------------------------+ |Stability Level | Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
isa(4), attributes(5), ddi_get8(9F), ddi_get8(9F), ddi_get8(9F), ddi_rep_get8(9F), ddi_rep_get8(9F), ddi_rep_get8(9F), outb(9F) Writing Device Drivers SunOS 5.11 16 Jan 2006 inb(9F)