Sponsored Content
Full Discussion: translate sed to awk
Top Forums Shell Programming and Scripting translate sed to awk Post 302578987 by adam25bc on Saturday 3rd of December 2011 01:44:31 PM
Old 12-03-2011
Thanks Ahmed,

what about the file?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

translate text (1 position) with sed

Hello, I'm trying to translate a fixed length (the first 6 positions) that begins with a 0 to overwrite the field with an *. Any suggestion? File 1 ------- 013344 01:20 222343 19:30 233333 20:30 File 2 (result) ----------------- ****** 01:20 222343 19:30 233333 20:30 (5 Replies)
Discussion started by: peterk
5 Replies

2. Shell Programming and Scripting

Can someone help translate this snippet?

Hello all - This snippet from a script runs on a Tru64 machine (ksh). if ps -ef | grep thing1 | grep dtsession | grep -v grep then echo "Killing Thing1 desktop session" kill -9 'ps -ef | grep thing1 | grep dtsession | grep -v grep | awk '{FS = " "}{print $2}'' fi I'm... (7 Replies)
Discussion started by: Heron
7 Replies

3. Shell Programming and Scripting

translate rc to string

Hi Maybe you can suggest a nicer way to do the following: RET_STR=$(echo ${RET} | sed -e 's/0/Object is not mapped/' \ -e 's/1/Operation Internal Error/' \ -e 's/2/Operation Invalid Arguments/' \ -e 's/3/Object is mapped/' \ -e 's/4/Path not found/') (3 Replies)
Discussion started by: ynir
3 Replies

4. Shell Programming and Scripting

replcement/translate of ' to ''

Hi i have a variable whose value contains '(single quote) i want to replace single quote with two single quotes ex- i want to replace abc's second center with abc''s second center. Plz help me. thanks (2 Replies)
Discussion started by: bmrout007
2 Replies

5. UNIX for Dummies Questions & Answers

translate timestamp

my file creation timestamp looks like this: Nov 4 15:44:34 EST 2009 i need to translate into 091104 my way is to awk on $1, $2, $5, but i don't know how to tranlate Nov to 11 ---------- Post updated at 03:01 PM ---------- Previous update was at 11:07 AM ---------- i resolved my post... (0 Replies)
Discussion started by: tjmannonline
0 Replies

6. UNIX for Dummies Questions & Answers

Help translate code

Hi, all of you!!! I have this code and I won to build-in some more code. I know this is a lot of code. if ; then if ; then SYSROOT="$1" S_SCRIPT="cd $1 ; ./etc/rc.sysinit 2>&1 &" fi else ... (22 Replies)
Discussion started by: jokerper
22 Replies

7. Shell Programming and Scripting

translate this string

Hi, I'm using code below to assign title for Putty Window to show user@hostname+curr directory. Trying to read this "write only" language, can anybody help me to go thru this string, too many thing in it I can't expaing Tx T export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:... (1 Reply)
Discussion started by: trento17
1 Replies

8. Shell Programming and Scripting

Translate grep to awk

sed -n "2,10p" lfile | egrep error | egrep -vc memory sed -n "2,10p" lfile | egrep error | egrep -v memory sed -n "2,10p" lfile | egrep error | egrep -c memory sed -n "2,10p" lfile | egrep error | egrep memory above are four separate commands. i want to combine the grep in each... (7 Replies)
Discussion started by: SkySmart
7 Replies

9. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

10. Shell Programming and Scripting

Translate bash mathematical calculation to awk

this code below is very useful in calculating mean and quartiles. however, i would really like to translate it to awk without having to write to any external file: #!/bin/sh filename="tmp.txt" sort -n $1 >$filename rows=`wc -l $filename|cut -d' ' -f1` q2=`echo "($rows+1)/2" |bc` ... (3 Replies)
Discussion started by: SkySmart
3 Replies
PIM(4)							   BSD Kernel Interfaces Manual 						    PIM(4)

NAME
pim -- Protocol Independent Multicast SYNOPSIS
options MROUTING #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/ip_mroute.h> #include <netinet/pim.h> int getsockopt(int s, IPPROTO_IP, MRT_PIM, void *optval, socklen_t *optlen); int setsockopt(int s, IPPROTO_IP, MRT_PIM, const void *optval, socklen_t optlen); int getsockopt(int s, IPPROTO_IPV6, MRT6_PIM, void *optval, socklen_t *optlen); int setsockopt(int s, IPPROTO_IPV6, MRT6_PIM, const void *optval, socklen_t optlen); DESCRIPTION
PIM is the common name for two multicast routing protocols: Protocol Independent Multicast - Sparse Mode (PIM-SM) and Protocol Independent Multicast - Dense Mode (PIM-DM). PIM-SM is a multicast routing protocol that can use the underlying unicast routing information base or a separate multicast-capable routing information base. It builds unidirectional shared trees rooted at a Rendezvous Point (RP) per group, and optionally creates shortest-path trees per source. PIM-DM is a multicast routing protocol that uses the underlying unicast routing information base to flood multicast datagrams to all multi- cast routers. Prune messages are used to prevent future datagrams from propagating to routers with no group membership information. Both PIM-SM and PIM-DM are fairly complex protocols, though PIM-SM is much more complex. To enable PIM-SM or PIM-DM multicast routing in a router, the user must enable multicast routing and PIM processing in the kernel (see SYNOPSIS about the kernel configuration options), and must run a PIM-SM or PIM-DM capable user-level process. From developer's point of view, the programming guide described in the Programming Guide section should be used to control the PIM processing in the kernel. Programming Guide After a multicast routing socket is open and multicast forwarding is enabled in the kernel (see multicast(4)), one of the following socket options should be used to enable or disable PIM processing in the kernel. Note that those options require certain privilege (i.e., root privilege): /* IPv4 */ int v = 1; /* 1 to enable, or 0 to disable */ setsockopt(mrouter_s4, IPPROTO_IP, MRT_PIM, (void *)&v, sizeof(v)); /* IPv6 */ int v = 1; /* 1 to enable, or 0 to disable */ setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_PIM, (void *)&v, sizeof(v)); After PIM processing is enabled, the multicast-capable interfaces should be added (see multicast(4)). In case of PIM-SM, the PIM-Register virtual interface must be added as well. This can be accomplished by using the following options: /* IPv4 */ struct vifctl vc; memset(&vc, 0, sizeof(vc)); /* Assign all vifctl fields as appropriate */ ... if (is_pim_register_vif) vc.vifc_flags |= VIFF_REGISTER; setsockopt(mrouter_s4, IPPROTO_IP, MRT_ADD_VIF, (void *)&vc, sizeof(vc)); /* IPv6 */ struct mif6ctl mc; memset(&mc, 0, sizeof(mc)); /* Assign all mif6ctl fields as appropriate */ ... if (is_pim_register_vif) mc.mif6c_flags |= MIFF_REGISTER; setsockopt(mrouter_s6, IPPROTO_IPV6, MRT6_ADD_MIF, (void *)&mc, sizeof(mc)); Sending or receiving of PIM packets can be accomplished by opening first a ``raw socket'' (see socket(2)), with protocol value of IPPROTO_PIM: /* IPv4 */ int pim_s4; pim_s4 = socket(AF_INET, SOCK_RAW, IPPROTO_PIM); /* IPv6 */ int pim_s6; pim_s6 = socket(AF_INET6, SOCK_RAW, IPPROTO_PIM); Then, the following system calls can be used to send or receive PIM packets: sendto(2), sendmsg(2), recvfrom(2), recvmsg(2). SEE ALSO
getsockopt(2), recvfrom(2), recvmsg(2), sendmsg(2), sendto(2), setsockopt(2), socket(2), inet(4), intro(4), ip(4), multicast(4) STANDARDS
The PIM-SM protocol is specified in RFC 2362 (to be replaced by draft-ietf-pim-sm-v2-new-*). The PIM-DM protocol is specified in draft-ietf-pim-dm-new-v2-*). AUTHORS
The original IPv4 PIM kernel support for IRIX and SunOS-4.x was implemented by Ahmed Helmy (USC and SGI). Later the code was ported to vari- ous BSD flavors and modified by George Edmond Eddy (Rusty) (ISI), Hitoshi Asaeda (WIDE Project), and Pavlin Radoslavov (USC/ISI and ICSI). The IPv6 PIM kernel support was implemented by the KAME project (http://www.kame.net), and was based on the IPv4 PIM kernel support. This manual page was written by Pavlin Radoslavov (ICSI). BSD
February 12, 2007 BSD
All times are GMT -4. The time now is 12:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy