10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have a fixed width file , where each line is 3200 length.
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
2. Shell Programming and Scripting
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
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.
#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. Shell Programming and Scripting
I'm writing a bash script and i'm stuck
the out put of a dialog menu is
"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
5. Shell Programming and Scripting
hello everyone. I'm hoping someone can help me out here. I have 2 files. It looks like this:
abc1, defg, 50.00, mno,990
abc2, cats, 100.00, pops,991
abc3, dogs, 1.00, treat,992
990, airplanes, runway, doctor
991, jets, birds, much
990,... (13 Replies)
Discussion started by: crazyhpux
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
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
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
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:
Can anyone tell me the command to do... (4 Replies)
Discussion started by: jazz
10. UNIX for Dummies Questions & Answers
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
RTNETLINK(3) Linux Programmer's Manual RTNETLINK(3)
rtnetlink - macros to manipulate rtnetlink messages
rtnetlink_socket = socket(AF_NETLINK, int socket_type, NETLINK_ROUTE);
int RTA_OK(struct rtattr *rta, int rtabuflen);
void *RTA_DATA(struct rtattr *rta);
unsigned int RTA_PAYLOAD(struct rtattr *rta);
struct rtattr *RTA_NEXT(struct rtattr *rta, unsigned int rtabuflen);
unsigned int RTA_LENGTH(unsigned int length);
unsigned int RTA_SPACE(unsigned int length);
All rtnetlink(7) messages consist of a netlink(7) message header and appended attributes. The attributes should be manipulated only using
the macros provided here.
RTA_OK(rta, attrlen) returns true if rta points to a valid routing attribute; attrlen is the running length of the attribute buffer. When
not true then you must assume there are no more attributes in the message, even if attrlen is nonzero.
RTA_DATA(rta) returns a pointer to the start of this attribute's data.
RTA_PAYLOAD(rta) returns the length of this attribute's data.
RTA_NEXT(rta, attrlen) gets the next attribute after rta. Calling this macro will update attrlen. You should use RTA_OK to check the
validity of the returned pointer.
RTA_LENGTH(len) returns the length which is required for len bytes of data plus the header.
RTA_SPACE(len) returns the amount of space which will be needed in a message with len bytes of data.
These macros are nonstandard Linux extensions.
This manual page is incomplete.
Creating a rtnetlink message to set the MTU of a device:
struct nlmsghdr nh;
struct ifinfomsg if;
struct rtattr *rta;
unsigned int mtu = 1000;
int rtnetlink_sk = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
memset(&req, 0, sizeof(req));
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
req.nh.nlmsg_flags = NLM_F_REQUEST;
req.nh.nlmsg_type = RTM_NEWLINK;
req.if.ifi_family = AF_UNSPEC;
req.if.ifi_index = INTERFACE_INDEX;
req.if.ifi_change = 0xffffffff; /* ??? */
rta = (struct rtattr *)(((char *) &req) +
rta->rta_type = IFLA_MTU;
rta->rta_len = RTA_LENGTH(sizeof(unsigned int));
req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));
send(rtnetlink_sk, &req, req.nh.nlmsg_len, 0);
netlink(3), netlink(7), rtnetlink(7)
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.