10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
i have a fixed width file , where each line is 3200 length.
File:
1ABC 1111 2222 3333 000012341 1001
2ABC 1111 2222 3333 000012342 1002
3ABC 1111 2222 3333 000112343 1003
1DEF 5555 4444 9696 000012344 1004
2DEF 5555 2323 8686 000012345 1005
3DEF 5555 1212 7676 000012346 1006
... (1 Reply)
Discussion started by: mechvijays
1 Replies
2. Shell Programming and Scripting
Hello all,
short story: I'm writing a script to add and remove dns records in dns files. Its on a RHEL 5.5
So far i've locked up the basic operations in a couple of functions:
- validate the parameters
- search for existant ip in file when adding
- search for existant name records in... (6 Replies)
Discussion started by: maverick72
6 Replies
3. Shell Programming and Scripting
I have a requirement where I want to add a comment '#' in my crontab, run a process, than remove the '#' I added.
Example cron
#5,10 * * * * ls -lt /tmp
10,5 * * * * ls -lt /var
I would like to be able use sed or awk to add a '#' at the begining of each
line. After the command... (4 Replies)
Discussion started by: BeefStu
4 Replies
4. Shell Programming and Scripting
I'm writing a bash script and i'm stuck
the out put of a dialog menu is
echo $select
"foo" "bar" "lemon" cheese"
while I need
$foo $bar $lemon $cheese
to reuse them as strings later in the script
and very new to bash scripting and i've no idea how to do this
any help would be... (2 Replies)
Discussion started by: xpd259
2 Replies
5. Shell Programming and Scripting
hello everyone. I'm hoping someone can help me out here. I have 2 files. It looks like this:
File 1:
abc1, defg, 50.00, mno,990
abc2, cats, 100.00, pops,991
abc3, dogs, 1.00, treat,992
File 2:
990, airplanes, runway, doctor
991, jets, birds, much
990,... (13 Replies)
Discussion started by: crazyhpux
13 Replies
6. UNIX for Dummies Questions & Answers
Hello everyone and let me start off by thanking anyone who can help with this.
I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Discussion started by: disgracedsaint
3 Replies
7. Solaris
I have a Solaris 10 container that is running on ZFS filesystems being presented from the Global Zone.
I have a filesystem presented to the Local zone and my user wants me to remove it.
It there any way I can remove this while the zone is running?
I tried unmounting it from the local zone... (0 Replies)
Discussion started by: BG_JrAdmin
0 Replies
8. Programming
Hi ,
Thanks for your time .
I am working on a application , which adds unix user through useradd and deletes user through userdel . both are admin commands .
My requirement is i have to add a user into at.allow whenver a unix user is added through my application and the user should be... (4 Replies)
Discussion started by: naren_chella
4 Replies
9. Programming
I have a file which contains numbers as follows:
1234 9876 6789 5677 3452
9087 4562 1367 2678 7891
I need to remove the empty spaces and add commas between the numbers like:
1234,9876,6789,5677,3452,
9087,4562,1367,2678,7891
Can anyone tell me the command to do... (4 Replies)
Discussion started by: jazz
4 Replies
10. UNIX for Dummies Questions & Answers
Hi there,
I just installed a Sparc 4-port Ethernet adapter on my sparc 10 and was wondering how on earth I find out what the names of the ports are. It looks like on startup that on SBus1 there is something called qec qe qe qe qe. So I tried to do an IFCONFIG qe0...but had no success. Can anyone... (3 Replies)
Discussion started by: jskillet
3 Replies
libnetlink(3) Library Functions Manual libnetlink(3)
NAME
libnetlink - A library for accessing the netlink service
SYNOPSIS
#include <asm/types.h>
#include <libnetlink.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
int rtnl_send(struct rtnl_handle *rth, char *buf, int len)
int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
int rtnl_dump_filter(struct rtnl_handle *rth,
int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
void *arg1,
int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
void *arg2)
int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
unsigned groups, struct nlmsghdr *answer,
int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
void *jarg)
int rtnl_listen(struct rtnl_handle *rtnl,
int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
void *jarg)
int rtnl_from_file(FILE *rtnl,
int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
void *jarg)
int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen)
int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen)
DESCRIPTION
libnetlink provides a higher level interface to rtnetlink(7). The read functions return 0 on success and a negative errno on failure. The
send functions return the amount of data sent, or -1 on error.
rtnl_open
Open a rtnetlink socket and save the state into the rth handle. This handle is passed to all subsequent calls. subscriptions is a
bitmap of the rtnetlink multicast groups the socket will be a member of.
rtnl_wilddump_request
Request a full dump of the type database for family addresses. type is a rtnetlink message type.
rtnl_dump_request
Request a full dump of the type data buffer into buf with maximum length of len. type is a rtnetlink message type.
rtnl_dump_filter
Receive netlink data after a request and filter it. The filter callback checks if the received message is wanted. It gets the
source address of the message, the message itself and arg1 as arguments. 0 as return means that the filter passed, a negative value
is returned by rtnl_dump_filter in case of error. NULL for filter means to not use a filter. junk is used to filter messages not
destined to the local socket. Only one message bundle is received. Unless there is no message pending, this function does not
block.
rtnl_listen
Receive netlink data after a request and pass it to handler. handler is a callback that gets the message source address, the mes-
sage itself, and the jarg cookie as arguments. It will get called for all received messages. Only one message bundle is received.
Unless there is no message pending this function does not block.
rtnl_from_file
Works like rtnl_listen, but reads a netlink message bundle from the file file and passes the messages to handler for parsing. The
file contains raw data as received from a rtnetlink socket.
The following functions are useful to construct custom rtnetlink messages. For simple database dumping with filtering it is better to use
the higher level functions above. See rtnetlink(3) and netlink(3) on how to generate a rtnetlink message. The following utility functions
require a continuous buffer that already contains a netlink message header and a rtnetlink request.
rtnl_send
Send the rtnetlink message in buf of length len to handle rth.
addattr32
Add a __u32 attribute of type type and with value data to netlink message n, which is part of a buffer of length maxlen.
addattr_l
Add a variable length attribute of type type and with value data and alen length to netlink message n, which is part of a buffer of
length maxlen. data is copied.
rta_addattr32
Initialize the rtnetlink attribute rta with a __u32 data value.
rta_addattr32
Initialize the rtnetlink attribute rta with a variable length data value.
BUGS
The functions sometimes use fprintf and exit when a fatal error occurs. This library should be named librtnetlink.
AUTHORS
netlink/rtnetlink was designed and written by Alexey Kuznetsov. Andi Kleen wrote the man page.
SEE ALSO
netlink(7), rtnetlink(7)
/usr/include/linux/rtnetlink.h
libnetlink(3)