Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Using SED to append character to each line Post 302079303 by c0nn0r on Saturday 8th of July 2006 09:07:59 PM
Old 07-08-2006
Quote:
Originally Posted by reborg
Code:
/amstracker -u 0.05 -s | sed 's/.*/&;/'

Thanx, but it still does not work for me.

I'll be more specific:

After the ./amstracker -u 0.05 -s | sed 's/.*/&;/'

I want to pipe it into netcat (nc) so I can send it over the network, or to another port on the same machine. I know it's a weird setup, but it's a hack that will save me a lot of work in the future.

When I do:

./amstracker -u 0.05 -s | sed 's/.*/&;/' | nc 127.0.0.1 5001

it connects to an instance of: nc -l -p 5001 (on 127.0.0.1)

but no data goes thorough...

I'm cleary an idiot.


Any more suggestions?
 
Test Your Knowledge in Computers #236
Difficulty: Easy
The ARPANET was operated by the AT&T during the two decades of its existence, until 1990.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

append a character at end of each line of a file

Hi, i want to append a character '|' at end of each line of a file abc.txt. for example if the file abc.txt conatins: a|b|c 1|2|33 w|2|11 i want result file xyz.txt a|b|c| 1|2|33| w|2|11| I know this is simple but sumhow i am not able to reach end of line. its urgent, thanks for... (4 Replies)
Discussion started by: muaz
4 Replies

2. Shell Programming and Scripting

Sed append newline character

Hi All, I am new to Shell scripting.. I have a task to parse the text file into csv format. more then half the things has done. But the problem is when I use the sed command in shell script. it appends newline character at the end of the line. and so when I open the file in CSV it's format... (3 Replies)
Discussion started by: Gaurang033
3 Replies

3. Shell Programming and Scripting

How to append a character to the last but one field on a specific line?

Hi Guys, I have a file like this: aaa b c d e f fsss g h i k l qqq r t h n I want: aaa b c d e f fsss g h i k l qqq r t h , n ggg p t e d u qqq i o s , k (2 Replies)
Discussion started by: npatwardhan
2 Replies

4. Shell Programming and Scripting

How to append line with sed?

Input: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly Output should be: gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly How can it be done with sed? (5 Replies)
Discussion started by: cola
5 Replies

5. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

6. Shell Programming and Scripting

sed append without using new line

im trying to append to the end of the line using sed but I want to do it without creating a new line the text to which I want to append is all in capital letters. I want to do something like this: LINE]Foo but when I do this: //a\ ] Foo it prints foo on a new line: LINE ]Foo ... (11 Replies)
Discussion started by: mrjavoman
11 Replies

7. Shell Programming and Scripting

Search for a string, then append character to end of that line only

I have 2 files that I am working with $ cat file1 server1 server3 server5 server6 server8 $ cat file2 server1;Solaris; server2; SLES; server3;Linux; server4; Solaris; server5;SLES; server6;SLES; server7;Solaris; server8;Linux; (1 Reply)
Discussion started by: snoman1
1 Replies

8. Shell Programming and Scripting

Sed: delete on each line before a character and after a character

Hi there, A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis). The original file would look like... (3 Replies)
Discussion started by: bnbsd
3 Replies

9. Shell Programming and Scripting

sed - append line after block

Hi, I posted in another section, but no reply yet. I have an ini file with sections denoted as follows (for example) blah=blah blee=blee bloo=bloo blur=blur blaa=blaa I have ksh script that needs to append a line ${line} to the end of section ${section} I saw this... (7 Replies)
Discussion started by: andyatit
7 Replies

10. UNIX for Beginners Questions & Answers

Append each line based upon the character size

I have a huge file which contains multiple lines. It need to check whether character length is not more than 255 each line. If its not then it should remove the character up to column. I have described in the output below. If its more than that the next line should start with call but if the... (1 Reply)
Discussion started by: JoshvaPeter
1 Replies
NE_IADDR_MAKE(3)						neon API reference						  NE_IADDR_MAKE(3)

NAME
ne_iaddr_make, ne_iaddr_cmp, ne_iaddr_print, ne_iaddr_typeof, ne_iaddr_free - functions to manipulate and compare network addresses SYNOPSIS
#include <ne_socket.h> typedef enum { ne_iaddr_ipv4 = 0, ne_iaddr_ipv6 } ne_iaddr_type; ne_inet_addr *ne_iaddr_make(ne_iaddr_type type, const unsigned char *raw); int ne_iaddr_cmp(const ne_inet_addr *ia1, const ne_inet_addr *ia2); char *ne_iaddr_print(const ne_inet_addr *ia, char *buffer, size_t bufsiz); ne_iaddr_type ne_iaddr_typeof(const ne_inet_addr *ia); void ne_iaddr_free(const ne_inet_addr *ia); DESCRIPTION
ne_iaddr_make creates an ne_inet_addr object from a raw binary network address; for instance the four bytes 0x7f 0x00 0x00 0x01 represent the IPv4 address 127.0.0.1. The object returned is suitable for passing to ne_sock_connect. A binary IPv4 address contains four bytes; a binary IPv6 address contains sixteen bytes; addresses passed must be in network byte order. ne_iaddr_cmp can be used to compare two network addresses; returning zero only if they are identical. The addresses need not be of the same address type; if the addresses are not of the same type, the return value is guaranteed to be non-zero. ne_iaddr_print can be used to print the human-readable string representation of a network address into a buffer, for instance the string "127.0.0.1". ne_iaddr_typeof returns the type of the given network address. ne_iaddr_free releases the memory associated with a network address object. RETURN VALUE
ne_iaddr_make returns NULL if the address type passed is not supported (for instance on a platform which does not support IPv6). ne_iaddr_print returns the buffer pointer, and never NULL. EXAMPLES
The following example connects a socket to port 80 at the address 127.0.0.1. unsigned char addr[] = "x7fx00x00x01"; ne_inet_addr *ia; ia = ne_iaddr_make(ne_iaddr_ipv4, addr); if (ia != NULL) { ne_socket *sock = ne_sock_connect(ia, 80); ne_iaddr_free(ia); /* ... */ } else { /* ... */ } SEE ALSO
ne_addr_resolve AUTHOR
Joe Orton <neon@lists.manyfish.co.uk> Author. COPYRIGHT
neon 0.28.4 25 February 2009 NE_IADDR_MAKE(3)

Featured Tech Videos

All times are GMT -4. The time now is 05:03 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy