Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Script is ignoring   Post 302753551 by sathyaonnuix on Wednesday 9th of January 2013 02:44:18 AM
Old 01-09-2013
[Solved] Script is ignoring  

Experts,

I am finding the split up of the Servers which uses the netstat on a specific port.

Code:
netstat -a | grep -w 9071 |grep ESTABLISHED | awk '{print $5}' | cut -d'.' -f1 | sort -n | uniq -c
   1 ser7b
   1 ser7c
   2 ser7d
   2 ser7e
   1 ser7f
   1 ser7h
   1 ser7i
   1 ser8b

I am trying to email this details:
Code:
print "<br><br>Split up on Port 9071:<br>$(netstat -a| grep -w 9070 |grep ESTABLISHED | awk '{print $5}' | cut -d'.' -f1 | sort -n | uniq -c" > file
cat file | sendmail -t

But when I open my email I can see all the servers split up are aligned in a single line rather than in "\n".
Code:
1 ser7b  1 ser7c  2 ser7d  2 ser7e.....

By googling found out that we need to add &nbsp; to it, can you people help me with it. Thanks

Last edited by radoulov; 01-09-2013 at 05:55 AM.. Reason: Marked as solved.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

&nbsp; ??

What does &nbsp; do ?? I have read this in a question but have never come accross it. (5 Replies)
Discussion started by: finster
5 Replies

2. Shell Programming and Scripting

Is it possible - SCP script ignoring certain files

Hey everyone. First, let me preface this post by stating that there are some bad things I'm doing. I'm using python to work around SCP's refusal to take standard input for a password. The reason for doing this as opposed to using keys is because the servers are on lock down due to them being in our... (1 Reply)
Discussion started by: msarro
1 Replies

3. Shell Programming and Scripting

Simple Bash Script:ignoring --exclude?

My super simple script works fine when I type it in manually but when I run it from a file as a script the --exclude option is ignored...what am I missing here? #!/usr/bin/bash tar czvf PackUpCases case0* log* --exclude runtpe (5 Replies)
Discussion started by: cpabrego
5 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Using awk to obtain minimum of each column (ignoring zeros)

Hi, I have a wide and long dataset which looks as follows: 0 3 4 2 3 0 2 2 ... 3 2 4 0 2 2 2 3 ... 0 3 4 2 0 4 4 4 ... 3 0 4 2 2 4 2 4 ... .... I would like to obtain the minimum of each column (ignoring zero values) so the output would look like: 3 2 4 2 2 2 2 2 I have the... (3 Replies)
Discussion started by: kasan0
3 Replies

5. UNIX for Dummies Questions & Answers

[solved] Where & what bash env file, Mac OS?

Hi! I wanted to simplify my bash prompt, so I edited my etc/bashrc file. I thought this was the file that would override any other env files. When I opened it, I saw that the way it was setup was not what my prompt looked like, although I forget exactly what was there. But i edited it the way I... (1 Reply)
Discussion started by: sudon't
1 Replies

6. Shell Programming and Scripting

[Solved] BASH - chaining TEST and COMMAND with && and II

Can you explain what this line of script is doing. What I have understood is : -- variable C is the name of a software which is either not installed, so it must be installed or allready installed and then should be update if newer version found -- branch B="$B $C" is to install the software --... (4 Replies)
Discussion started by: jcdole
4 Replies

7. Shell Programming and Scripting

[Solved] Get files & delete them by shell script

I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Discussion started by: arm
2 Replies

8. Shell Programming and Scripting

[Solved] Isolating & Counting IP from log file

Dear Community, today my website was under attack for several hours. 2 specific IPs make a tons of "get requests" to a specific page and apache server goes up and down. Now the problem is solved because I put in firewall blacklist these IPs, but I took a lot of time to analyze the apache log to... (6 Replies)
Discussion started by: Lord Spectre
6 Replies

9. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

10. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
inet_type(4)							   File Formats 						      inet_type(4)

NAME
inet_type - default Internet protocol type SYNOPSIS
/etc/default/inet_type DESCRIPTION
The inet_type file defines the default IP protocol to use. Currently this file is only used by the ifconfig(1M) and netstat(1M) commands. The inet_type file can contain a number of <variable>=<value> lines. Currently, the only variable defined is DEFAULT_IP, which can be assigned a value of IP_VERSION4, IP_VERSION6, or BOTH. The output displayed by the ifconfig and netstat commands can be controlled by the value of DEFAULT_IP set in inet_type file. By default, both commands display the IPv4 and IPv6 information available on the system. The user can choose to suppress display of IPv6 information by setting the value of DEFAULT_IP. The following shows the possible values for DEFAULT_IP and the resulting ifconfig and netstat output that will be displayed: IP_VERSION4 Displays only IPv4 related information. The output displayed is backward compatible with older versions of the ifconfig(1M) and netstat(1M) commands. IP_VERSION6 Displays both IPv4 and IPv6 related information for ifconfig and netstat. BOTH Displays both IPv4 and IPv6 related information for ifconfig and netstat. The command-line options to the ifconfig and netstat commands override the effect of DEFAULT_IP as set in the inet_type file. For example, even if the value of DEFAULT_IP is IP_VERSION4, the command example% ifconfig -a6 will display all IPv6 interfaces. EXAMPLES
Example 1: Suppressing IPv6 Related Output This is what the inet_type file must contain if you want to suppress IPv6 related output: DEFAULT_IP=IP_VERSION4 SEE ALSO
ifconfig(1M), netstat(1M) SunOS 5.10 16 Jun 1999 inet_type(4)
All times are GMT -4. The time now is 07:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy