Sponsored Content
Top Forums Shell Programming and Scripting Count total unique destination for source Post 302213411 by radoulov on Thursday 10th of July 2008 03:52:44 AM
Old 07-10-2008
Yep,
your requirement is more than clear,
sorry for the noise.
Use this code:

Code:
awk 'END {
  for (k in u) {
    printf "%s\t%s\t%s\t%s\n", 
	  k, u[k], f[k], b[k]
  }
}  
NR > 1 { 
  _[$1,$2]++ ? u[$1] : ++u[$1] 
  f[$1] += $3 
  b[$1] += $4 
  }' file

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Byte Rate to/from a source/destination

is there a command in unix/linux that allows you to sample what the historic byte rate is from a local IP to a client IP. (1 Reply)
Discussion started by: cubs0729
1 Replies

2. IP Networking

Selecting interface based on source and destination ip address

Hi all, I have some doubts in selecting the interface to transfer packets and receive the packets. --> Multiple interfaces : -------------------- 1) 0.0.0.0 --------> wild card address. 2) x.x.x.x --------> valid address.(192.168.1.156) 3) ff.ff.ff.ff -------->... (0 Replies)
Discussion started by: vijaypdp2006
0 Replies

3. Shell Programming and Scripting

Move all files from source to destination directory based on the filename

Move all files starting with a specific name to different directory. This shell script program should have three parameters File Name Source Directory Destination Directory User should be able to enter ‘AB_CD*' in file name parameter. In this case all the files starting with AB_CD will... (1 Reply)
Discussion started by: chetancrsp18
1 Replies

4. Linux

rpmbuild, how to specify a different source and destination path for files

I'd like to specify a different build and deployment path for files, by default the same path is used for both build and install, I wasn't able to find a way to make these different. With Solaris pkgadd, one can specify different paths in prototype, so I would assume something like that is possible... (0 Replies)
Discussion started by: tiburblium
0 Replies

5. Solaris

Ftp: SSL_connect error while connecting from source to destination server Solaris 10

Hi Everyone, I am using solaris 10.I am facing a different problem here with tlsftp.I have intalled all steps for tlsftp and able to connect to the destination server from the source server.It worked for some days.But recently when i am connectin it is giving below error.I am... (0 Replies)
Discussion started by: muraliinfy04
0 Replies

6. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh usa0300uz1247.apps.mc.xerox.com... (0 Replies)
Discussion started by: lovelysethii
0 Replies

7. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

8. Shell Programming and Scripting

Count the number of files copied from source to destination location

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files from... (23 Replies)
Discussion started by: sravanreddy
23 Replies

9. UNIX for Beginners Questions & Answers

Open ports from source to destination

Is there a way to find out all the ports open between source IP & destination IP in any way ? (12 Replies)
Discussion started by: UnknownGuy
12 Replies
XCopyArea()															       XCopyArea()

Name
  XCopyArea - copy an area of a drawable.

Synopsis
  XCopyArea(display, src, dest, gc, src_x, src_y, width,
	    height,  dest_x, dest_y)
	Display *display;
	Drawable src, dest;
	GC gc;
	int src_x, src_y;
	unsigned int width, height;
	int dest_x, dest_y;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  src	    Specify the source and destination rectangles to be combined.  src and dest must have the same root and depth.
  dest
  gc	    Specifies the graphics context.

  src_x     Specify the x and y coordinates of the upper-left corner of the source rectangle relative to the origin of the source drawable.
  src_y
  width     Specify the dimensions in pixels of both the source and destination rectangles.
  height
  dest_x    Specify the x and y coordinates within the destination window.
  dest_y

Description
  XCopyArea() combines the specified rectangle of src with the specified rectangle of dest.  src and dest must have the same root and depth.

  If  regions  of  the source rectangle are obscured and have not been retained in backing_store, or if regions outside the boundaries of the
  source drawable are specified, then those regions are not copied.  Instead, the following occurs on all corresponding  destination  regions
  that are either visible or are retained in backing_store.  If dest is a window with a background other than None, the corresponding regions
  of the destination are tiled (with plane_mask of all 1's and function GXcopy) with that background.  Regardless of tiling, if the  destina-
  tion	is a window and graphics_exposures in gc is True, then GraphicsExpose events for all corresponding destination regions are generated.
  If graphics_exposures is True but no regions are exposed, then a NoExpose event is generated.

  If regions of the source rectangle are not obscured and graphics_exposures is False, one NoExpose event is generated on the destination.

  XCopyArea() uses these graphics context components:  function, plane_mask, subwindow_mode, graphics_exposures,  clip_x_origin,  clip_y_ori-
  gin, and clip_mask.

Errors
  BadDrawable

  BadGC

  BadMatch    The src and dest rectangles do not have the same root and depth.

See Also
  XClearArea(),  XClearWindow(), XCopyPlane(), XDraw, XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(), XDrawLines(), XDrawPoint(), XDraw-
  Points(), XDrawRectangle(), XDrawRectangles(), XDrawSegments(), XFillArc(),  XFillArcs(),  XFillPolygon(),  XFillRectangle(),  XFillRectan-
  gles().

Xlib - Drawing Primitives													       XCopyArea()
All times are GMT -4. The time now is 02:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy