Hello! I am writing a program that reads a bunch of arguments from the command line,then read information from a file(passed as one of the arguments) and do some computation. The problem I am facing is when a backslash(\) is present as one of the arguments, suppose $ myprog \ abc xyz,the backslash... (2 Replies)
Hi,
I have a variable read from user input:
PROFILESROOTDIR="\\194.185.82.188\CMSRepository\EncodingProfiles"
awk -F"=" -v gr=$PROFILESROOTDIR '/ProfilesRootDirectoryFromXOEMachine/{$2=gr;}1' OFS="=" $CFGFILE > "${CFGFILE}_new"
For this awk to work properly I need to replace in the... (7 Replies)
Hi Experts,
The question may look very silly by seeing the title, but please have a look at it clearly.
I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which... (3 Replies)
Dear People,
My query is:
have a file, which looks likes this:
10 20 30 40 50
1 2 3 4 5
100 200 300 400 500
what i need is: "PRINT EACH LINE TO AN UNIQUE FILE"
desired output:
file 1
10 20 30 40 50
file 2
1 2 3 4 5 (3 Replies)
Dear all,
I am using Mac OSX, have been successfully written an awk script during the last days. I use the script to convert parts of a .dot-file into graphml code.
First question: Backslash
My .dot-code includes repeatedly the sign "\n".
I would like to search for this sign and substitute... (4 Replies)
hyper link- abc:8081/xyz/2.5.6/rtyp-2.5.6.jar
Needs to get "rtyp-2.5.6.jar" i.e character after last backslash "/"
how to do this using sed/awk??
help is highly appreciated. (7 Replies)
Hi All.
I have a file that contains some special characters and I'm trying to use AWK to search for lines between <pattern1> and <pattern2>.
As an example:
I need the lines between the line containing ' select_id="x_0 ' and the line containing the next instance of ' from '. This is a file... (5 Replies)
pointsb=`awk -v a2="$a2" -v b2="$b2" -v c2="$c2" -v yb="$yb" -v yc="$yc" \
'BEGIN { for (y=yc; y<=yb; y++) { x = a2*y*y+b2*y+c2; print x, y }; }'`
I am learning shell script. I was reading a script and got confused in this line.
I understood that awk is allowing to assign the variable.
But... (10 Replies)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Discussion started by: TestPractice
5 Replies
LEARN ABOUT REDHAT
inet_ntop
inet_ntop(3) Linux Programmer's Manual inet_ntop(3)NAME
inet_ntop - Parse network address structures
SYNOPSIS
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
const char *inet_ntop(int af, const void *src,
char *dst, size_t cnt);
DESCRIPTION
This function converts the network address structure src in the af address family into a character string, which is copied to a character
buffer dst, which is cnt bytes long.
inet_ntop(3) extends the inet_ntoa(3) function to support multiple address families, inet_ntoa(3) is now considered to be deprecated in
favor of inet_ntop(3). The following address families are currently supported:
AF_INET
src points to a struct in_addr (network byte order format) which is converted to an IPv4 network address in the dotted-quad format,
"ddd.ddd.ddd.ddd". The buffer dst must be at least INET_ADDRSTRLEN bytes long.
AF_INET6
src points to a struct in6_addr (network byte order format) which is converted to a representation of this address in the most
appropriate IPv6 network address format for this address. The buffer dst must be at least INET6_ADDRSTRLEN bytes long.
RETURN VALUE
inet_ntop returns a non-null pointer to dst. NULL is returned if there was an error, with errno set to EAFNOSUPPORT if af was not set to a
valid address family, or to ENOSPC if the converted address string would exceed the size of dst given by the cnt argument.
SEE ALSO inet_pton(3)BUGS
AF_INET6 converts IPv6-mapped IPv4 addresses into an IPv6 format.
Linux Man Page 2000-12-18 inet_ntop(3)