Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Redirecting tmp files of SORT into different directory Post 302718993 by abhisheksunkari on Sunday 21st of October 2012 07:30:32 PM
Old 10-21-2012
Hello Jim,
Thanks a lot, I was unaware of the fact that, sort would depend on the TMPDIR variable. Anyway I ll try that immediately and let you know. I think it should work now.

Well, the file I am working with has around 33 mil lines.. so thats where the problem is.. I think it should work fine with the command you have given.

Thanks a lot for your time, I appreciate it.

Abhishek S.
 

10 More Discussions You Might Find Interesting

1. Red Hat

/tmp directory

i heard once that the /tmp directory was a ramfs (swap) that is cleared at reboot time, is this still the case in redhat EL 3 and 4 ? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

2. AIX

loop through the directory for files and sort by date and process the first file

hello i have a requirement where i have a direcotry in which i get files in the format STOCKS.20080114.dat STOCKS.20080115.dat STOCKS.20080117.dat STOCKS.20080118.dat i need to loop through the directory and sort by create date descending order and i need to process the first file. ... (1 Reply)
Discussion started by: dsdev_123
1 Replies

3. UNIX for Dummies Questions & Answers

Sort all files in a directory retaining originals

Hi, I need to sort all the files in a directory whilst retaining the originals. So if in the directory I have: File1 File2 File3 I want to sort these files so that I would have: File1 File1.sort File2 File2.sort File3 File3.sort where I have added the .sort extension to show... (4 Replies)
Discussion started by: ledgie
4 Replies

4. Shell Programming and Scripting

How to sort a set of files by date in a directory?

hi there, I have a directory which contents I can parse dynamically. I end up with a file list. I then want to display those files sorted by date, oldest files first. I have very very little PERL experience...Would anyone know how to do that ? Thanks in advance. (8 Replies)
Discussion started by: alexf
8 Replies

5. UNIX for Dummies Questions & Answers

Shell script which will sort all the files in a directory with the timestamp they were created

Team, Pls help writing a shell script which will sort all the files in a directory with the timestamp they were created. (like ls -lrt) (6 Replies)
Discussion started by: asappidi
6 Replies

6. Shell Programming and Scripting

Need script to remove millions of tmp files in /html/cache/ directory

Hello, I just saw that on my vps (centOS) my oscommerce with a seo script has created millions of tmp files inside the /html/cache/ directory. I would need to remove all those files (millions), I tried via shell but the vps loads goes to very high and it hangs, is there some way to do a... (7 Replies)
Discussion started by: andymc1
7 Replies

7. UNIX for Dummies Questions & Answers

using gsed with cp to sort files in directory - every N file copy to new place

Hi all, I'm having a problem with some basic piping issues... I have been able to get in a directory and ls | gsed in order to list every N file for instance: ls | gsed -n '2~5p' The thing is I want to be able to copy the output files to a new directory. Basically directory /all has a... (4 Replies)
Discussion started by: dgoss
4 Replies

8. Shell Programming and Scripting

Shell script to find the GB files in /tmp directory in remote server

Hi, i need help on shell scripting. Main intention of the script is step 1: ssh to remote server Step 2: cd /tmp in remote server Step 3: in tmp i want to grep only files and directories which are in GB sizes All the servers list file is - tmpsrv.txt vi tmpsrv.txt ... (17 Replies)
Discussion started by: kumar85shiv
17 Replies

9. UNIX for Beginners Questions & Answers

How do I custom sort the files in a directory using the filenames in a text file.?

Hi all, (5 Replies)
Discussion started by: KMusunuru
5 Replies

10. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies
XtWorkProc()															      XtWorkProc()

Name
  XtWorkProc - interface definition for procedure called when the event loop is idle.

Synopsis
  typedef Boolean (*XtWorkProc)(XtPointer);
	 XtPointer client_data;

Inputs
  client_data
	    Specifies data registered with this procedure.

Returns
  True if the procedure should not be called again; False otherwise.

Description
  An XtWorkProc is registered with XtAppAddWorkProc() and is called by XtAppMainLoop() and XtAppProcessEvent() if there are no events pending
  and the application would otherwise block.

  The client_data argument is data of any type registered in the call to XtAppAddWorkProc().  It is generally cast to an XtPointer when  reg-
  istered  and cast back to the appropriate type within the XtWorkProc.  An XtWorkProc must get all of its context from this argument or from
  global variables.

  An XtWorkProc should perform a single short task and return.	If it does not return quickly then events that arrive  while  it  is  running
  will not be handled immediately, and the response time seen by the user will suffer.	If a work procedure has a lot of processing to do, it
  should perform a piece of it, save its state in static variables, and return False.  When an XtWorkProc returns False, the Intrinsics  will
  call	it again the next time the event loop is idle, and it can resume its processing where it left off.  When it completes all of its pro-
  cessing, it should return True, and the Intrinsics will automatically un-register it, so that it will not be called again.

Usage
  One possible use of work procedures is to create the widgets in dialog boxes which are not needed immediately when  an  application  starts
  up.	This will save start up time for the main application window, and will probably also mean that the dialog boxes will be fully created
  by the time the user requests that one is popped up.

  You can register multiple work procedures, and they will be performed one at a time.	The most recent work procedure added has the  highest
  priority.  Therefore, for example, if you want to create ten popup widgets during idle time, you might add ten work procedures.  The pop up
  that you expect to need first should be created by the last work procedure registered.  See the example below for  an  alternate  approach,
  however.

  You can explicitly remove a work procedure with XtRemoveWorkProc().

Example
  The  first  procedure below is an XtWorkProc that creates several dialog widgets.  Note that it returns after creating each dialog.  If the
  dialogs are needed before they are created by this procedure, they will have to be created explicitly as  shown  in  the  second  procedure
  below.   The	only  standard client in X11R5 that uses work procedures is xfontsel which performs sophisticated scheduling of all the back-
  ground work of parsing the names of all the fonts available from the server.

     Widget file_dialog = NULL;
     Widget print_dialog = NULL;
     Widget confirm_dialog = NULL;

     Boolean CreateDialogsInBackground(client_data)
     XtPointer client_data;
     {
	 Widget toplevel = (Widget) client_data;
	 static int num = 0;

	 num++;

	 switch(num) {
	 case 1:
	     if (file_dialog == NULL)
		 file_dialog = CreateFileDialog(toplevel);
	     return False;
	 case 2:
	     if (print_dialog == NULL)
		 print_dialog = CreatePrintDialog(toplevel);
	     return False;
	 case 3:
	     if (confirm_dialog == NULL)
		confirm_dialog = CreateConfirmDialog(toplevel);
	     return True;
	 }
	 return True;
     }

     void DoFileDialog(toplevel)
     Widget toplevel;
     {
	 if (file_dialog == NULL)
	     file_dialog = CreateFileDialog(toplevel);
	 XtPopup(file_dialog, XtGrabExclusive);
     }

  This work procedure could be registered with a call like the following:

	 toplevel = XtAppInitialize(...);
	 BuildInterface(toplevel);
	 XtRealizeWidget(toplevel);

	 XtAppAddWorkProcedure(app_context, CreateDialogsInBackground,
			       (XtPointer) toplevel);

	 XtAppMainLoop(app_context);

See Also
  XtAppAddWorkProc(1), XtRemoveWorkProc(1).

Xt - Event Handling														      XtWorkProc()
All times are GMT -4. The time now is 04:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy