Sponsored Content
Full Discussion: using sed to get IP-address
Top Forums Shell Programming and Scripting using sed to get IP-address Post 302248152 by palsevlohit_123 on Friday 17th of October 2008 04:43:14 AM
Old 10-17-2008
Try out this...

Code:
node="node_ip:109.50.89.211; node:j20"

echo $node|awk -F";" '{print $1}'|awk -F":" '{print $2}'

will return the IP.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed: Multiple Commands applied to an address

Trying to write a sed command that applies multiple replacements to a specific address. Need a second pair of eyes I guess cause my syntax appears to be correct (obviously not though) I am getting an error. Any Help would be appreciated! Thanks in advance. sed -f foo envOracle sed: Function... (2 Replies)
Discussion started by: google
2 Replies

2. UNIX for Dummies Questions & Answers

$Variable address in sed

I'm attempting to append a line after a specific address with sed. If I type in the address eg.3 then it will append after the third line. I can't get it to work with a variable though. Does anyone know how to do it please? sed '/3/a\ text' filename :) sed '/\$address/a\ text' filename... (8 Replies)
Discussion started by: Sniper Pixie
8 Replies

3. UNIX for Dummies Questions & Answers

grep or sed help for a word and an IP address

I would like to grab only designates and the IP address next to it. I can also live with client-ip=xx.xx.xx.xx Any help is much appreciated. line to grep or sed: Received-SPF: pass (google.com: domain of support@uhb-hosting.de designates 80.67.28.12 as permitted sender)... (7 Replies)
Discussion started by: tigta09
7 Replies

4. Shell Programming and Scripting

Get Local IP address using Sed, Awk

Hi All, how to get solaris box local ip addresss in variable, using sed or awk utlities. Thanks, Mani Muthu (7 Replies)
Discussion started by: k_manimuthu
7 Replies

5. Shell Programming and Scripting

SED With Regex to extract Email Address

Hi Folks, In my program, I have a variable which consists of multiple lines. i need to use each line as an input. My intention is to extract the email address of the user in each line and use it to process further. The email address could be anywhere in the whole line. But there will be only... (5 Replies)
Discussion started by: ragz_82
5 Replies

6. Shell Programming and Scripting

HELP with awk or sed. Need to replace all IP address by 2

Hi, In a file, I have several time <IP>232.0.1.164</IP> ... <IP>232.0.1.135</IP> I need to replace all the random IP addresses , by 239.0.0.1 and 239.0.0.2 , alternatively. I try this grep "<IP>" tsp.xml | awk '{if(NR % 2)print $0}' | cut -d"<" -f2 | cut -d">" -f2 ... (3 Replies)
Discussion started by: FredMo
3 Replies

7. Solaris

Find and sed for an email address in Solaris 10

in Solaris 10 I am able to run: find . -type f -name "copy*" exec grep example.com {} \; and I get results. but when I try to find and sed: find . -type f -name "copy*" exec sed -e 's/user@example\.com/user2@example\.com' {} \; the command executes correctly but doesn't change... (6 Replies)
Discussion started by: os2mac
6 Replies

8. Shell Programming and Scripting

IP Address Modification through awk/sed

Hi, I have to modify the 2nd and 3rd octet of the IP address through awk/sed. For Example: Given IP is : 10.205.22.254, it should be modified as 10.105.100.254 through awk/sed. Kindly help me on this and let me know if you have any questions. Thanks in advances. (2 Replies)
Discussion started by: kumarbka
2 Replies

9. Shell Programming and Scripting

Sed: -e expression #1, char 16: unterminated address regex

I am trying to grep for a particular text (Do action on cell BL330) in a text file(sample.gz) which is searched in the content filtered by date+timestamp (2016-09-14 01:09:56,796 to 2016-09-15 04:10:29,719) on a remote machine and finally write the output into a output file on a local machine. ... (23 Replies)
Discussion started by: rbadveti
23 Replies

10. UNIX for Beginners Questions & Answers

Sed: -e expression #1, char 20: unterminated address regex

I am trying to add word in last of particular line. the same command syntex is running on prompt. but in bash script give error."sed: -e expression #1, char 20: unterminated address regex" Please help. for i in `cat servername`; do ssh -q -t root@$i sed -i '/simple_allow_groups =/s/$/,... (4 Replies)
Discussion started by: yash_message
4 Replies
semanage_node(3)					   Libsemanage API documentation					  semanage_node(3)

NAME
semanage_node - SELinux Network Nodes Management API SYNOPSIS
#include <semanage/node_record.h> #include <semanage/nodes_policy.h> #include <semanage/nodes_local.h> This object contains properties associated with a network node. For details on a specific function, see its manual page. Record API Overview semanage_node_create(3)- create a node semanage_node_free(3)- release resources for this node semanage_node_key_create(3)- create a key, which can be used to identify a node semanage_node_key_free(3)- release resources for this node key semanage_node_key_extract(3)- create a key matching this node semanage_node_clone(3)- create an identical node (deep-copy clone) semanage_node_compare(3)- compare this node to the provided key semanage_node_compare2(3)- compare this node to another Properties API Overview semanage_node_get_addr(3)- return the IP address of this node in string representation semanage_node_set_addr(3)- set the IP address of this node from the provided string representation and protocol semanage_node_get_addr_bytes(3)- return the IP address of this node as a byte array in network byte order semanage_node_set_addr_bytes(3)- set the IP address of this node from the provided byte array in network byte order semanage_node_get_mask(3)- return the IP mask of this node in string representation semanage_node_set_mask(3)- set the IP mask of this node from the provided string representation and protocol version semanage_node_get_mask_bytes(3)- return the IP mask of this node as a byte array in network byte order semanage_node_set_mask_bytes(3)- set the IP mask of this node from the provided byte array in network byte order semanage_node_get_proto(3)- return the IP protocol version for this node semanage_node_get_proto_str(3)- return a string representation of the given node protocol semanage_node_set_proto(3)- set the IP protocol version for this node semanage_node_get_con(3)- return the SELinux context associated with this node semanage_node_set_con(3)- set the SELinux context associated with this node Record Store API Overview semanage_node_modify_local(3)- add or update an interface in the local store semanage_node_del_local(3)- delete an interface from the local store semanage_node_exists(3)- check if an interface is defined in the persistent policy semanage_node_exists_local(3)- check if an interface is defined in the local store semanage_node_query(3)- query an interface in the persistent policy semanage_node_query_local(3)- query an interface in the local store semanage_node_count(3)- count the number of nodes defined in the persistent policy semanage_node_count_local(3)- count the number of nodes defined in the local store semanage_node_iterate(3)- execute a callback for each interface in the persistent policy semanage_node_iterate_local(3)- execute a callback for each interface in the local store semanage_node_list(3)- return an array containing all nodes in the persistent policy semanage_node_list_local(3)- return an array containing all nodes in the local store ivg2@cornell.edu 16 March 2006 semanage_node(3)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy