Sponsored Content
Full Discussion: Formatting port scan output
Top Forums Shell Programming and Scripting Formatting port scan output Post 302506013 by lewk on Friday 18th of March 2011 09:08:49 AM
Old 03-18-2011
Formatting port scan output

I need to format port scan output for input into another app.

This is what I have;

Code:
1025/tcp
1521/tcp
2301/tcp
2381/tcp
3191/tcp
3389/tcp
5938/tcp
47001/tcp
54321/tcp
21/tcp
80/tcp
135/tcp
139/tcp
445/tcp
1025/tcp

I want to chop the "/tcp" off, run it through uniq so that I only have the unique ports and then stack the output like below comma separated

Code:
1521, 2301, 2381, 3191, 3389, 5938, 47001, 54321, 21

Thanks!
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix program that can port scan a c block of ips for proxies

can anyone tell me a unix program that can port scan a c block of ips for proxies? a fast one, with reliable results, that can load an ip list, or set an ip range, and specify ports thanks! (1 Reply)
Discussion started by: user
1 Replies

2. UNIX for Advanced & Expert Users

Please let me know Regarding Port Scan

Can any one please let me know below ones 1) How to Perform the Port Scan in Solaris Environment and how to block the unwanted Ports. 2) How to know whether particular Port is listning the requests or not? Thanks Ramkumar.B (7 Replies)
Discussion started by: myramkumar
7 Replies

3. Shell Programming and Scripting

port scan shell script

Hi, Can any one please suggest me commands for making port scan shell script. (3 Replies)
Discussion started by: nrbhole
3 Replies

4. Shell Programming and Scripting

Formatting ls output

I am using find and ls to search for "warez" files on my server. find /home/ -regex ".*\.\(avi\|mp3\|mpeg\|mpg\|iso\)" -print0 | xargs -0 ls -oh This command produces this: -rw-r--r-- 1 1000 3.2M Feb 18 2009 /home/user/public_html/lupus.mp3 I want to only get this 3.2M... (4 Replies)
Discussion started by: bonrad
4 Replies

5. Shell Programming and Scripting

Use awk to turn character to newline then scan output

i have a datafile (data.txt) that has the following data: #Beginner`echo... (4 Replies)
Discussion started by: SkySmart
4 Replies
tcp.h(3HEAD)                                                          Headers                                                         tcp.h(3HEAD)

NAME
tcp.h, tcp - definitions for the Internet Transmission Control Protocol (TCP) SYNOPSIS
#include <netinet/tcp.h> DESCRIPTION
The <netinet/tcp.h> header defines the following macro for use as a socket option at the IPPROTO_TCP level: TCP_NODELAY Avoid coalescing of small segments. The macro is defined in the header. The implementation need not allow the value of the option to be set with setsockopt() or retrieved with getsockopt(). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
getsockopt(3XNET), socket.h(3HEAD), attributes(5), standards(5) SunOS 5.10 10 Sep 2004 tcp.h(3HEAD)
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy