Sponsored Content
Full Discussion: Help with slow KSH script
Top Forums UNIX for Dummies Questions & Answers Help with slow KSH script Post 302529618 by alister on Thursday 9th of June 2011 09:08:05 PM
Old 06-09-2011
If you have sufficient ram, you could have nawk read the tempfile once, when it starts, store its lines in an array, and then read the IDs from standard input. For each ID you can then iterate through the tempfile array and check for matches. This way, you don't have to create a new nawk process for each loop iteration nor do you have to read the file in its entirety once for each $x (even if the file's contents are cache'd by the operating system, it still requires a syscall for each read).


Regards,
Alister
This User Gave Thanks to alister For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

My script runs too slow :-(...

Hello experts, I have a series issue in script that result with bad peformence and I wonder if you can assist me. For example I have two files: File-New, size 15Mb. File-Old, size 1Mb. File-New content: a b c k File-Old content: d f a b (0 Replies)
Discussion started by: roybe
0 Replies

2. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

3. Shell Programming and Scripting

script to add numbers is slow

Hi, I am running a BASH shell with the following script. The script works and gives me correct output but is very slow with large files. The more rows and columns (width and height) the slower as you can probably see. How can I do what I want more efficiently? Any ideas welcome. It has been... (10 Replies)
Discussion started by: macsurveyr
10 Replies

4. Shell Programming and Scripting

Bash script too slow

I have a bash script that will take approx. 130 days to complete. I am trying to grep a list of 1,144 user ID's out of 41 (1 GB each) files. The 41 files were originally one 41 G file, but that was horrendously too slow.:eek: This is my current file: #!/bin/bash for i in `cat... (11 Replies)
Discussion started by: tigta09
11 Replies

5. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

6. Shell Programming and Scripting

Slow Perl script: how to speed up?

I had written a perl script to compare two files: new and master and get the output of the first file i.e. the first file: words that are not in the master file STRUCTURE OF THE TWO FILES The first file is a series of names ramesh sushil jonga sudesh lugdi whereas the second file (could be... (4 Replies)
Discussion started by: gimley
4 Replies

7. Shell Programming and Scripting

Slow Script Execution.

Basically my requirement is to know the total number of free anonymous ports. anonymous port range is 32768- 65535. i wrote a script for that ********************************************** for i in {32768..65535} do netstat -an | grep $i > /dev/null if ... (21 Replies)
Discussion started by: mohtashims
21 Replies

8. Shell Programming and Scripting

Slow down output from dhclient-script to screen

Hi I know the basic about script and sleep processes. However this is more tricky: I would like to run sh -x /sbin/dhclient-script and slow down the output of the script as a whole. How would you do it? I would like to delay output on the screen with 1 second for every line for the output... (3 Replies)
Discussion started by: medium_linux
3 Replies

9. Shell Programming and Scripting

Script to alert about a slow link on the website

Hello all, Currently I am using a script with "curl" to get the an alert if 200 ok would not be grepped.and the link is down. is it possible to get an alert mail if a particular link on a website is not completely down but SLOW?? (0 Replies)
Discussion started by: chirag991
0 Replies

10. Shell Programming and Scripting

Shell script reading file slow

I have shell program as below #!/bin/sh echo ======= LogManageri start ========== #This directory is getting the raw data from remote server Raw_data=/opt/ftplogs # This directory is ready for process the data Processing_dir=/opt/processing_dir # This directory is prcoessed files and... (4 Replies)
Discussion started by: Chenchireddy
4 Replies
WKHTMLTOPDF(1)						      General Commands Manual						    WKHTMLTOPDF(1)

Name
       wkhtmltopdf - html to pdf converter

Synopsis
	 wkhtmltopdf [OPTIONS]... <input file> [More input files] <output file>

Description
       Converts one or more HTML pages into a PDF document, not using wkhtmltopdf patched qt.

General Options
	   --allow <path>
	      Allow the file or files from the specified folder to be loaded (repeatable)
	   --collate
	      Collate when printing multiple copies
	   --cookie <name> <value>
	      Set an additional cookie (repeatable)
	   --cookie-jar <path>
	      Read and write cookies from and to the supplied cookie jar file
	   --copies <number>
	      Number of copies to print into the pdf file
	   --custom-header <name> <value>
	      Set an additional HTTP header (repeatable)
	   --debug-javascript
	      Show javascript debugging output
       -n, --disable-javascript
	      Do not allow web pages to run javascript
	   --disallow-local-file-access
	      Do not allowed conversion of a local file to read in other local files, unless explecitily allowed with --allow
       -d, --dpi <dpi>
	      Change the dpi explicitly (this has no effect on X11 based systems)
	   --enable-plugins
	      Enable installed plugins (such as flash
	   --encoding <encoding>
	      Set the default text encoding, for input
	   --extended-help
	      Display more extensive help, detailing less common command switches
       -g, --grayscale
	      PDF will be generated in grayscale
       -h, --help
	      Display help
	   --htmldoc
	      Output program html help
	   --ignore-load-errors
	      Ignore pages that claimes to have encountered an error during loading
       -l, --lowquality
	      Generates lower quality pdf/ps. Useful to shrink the result document space
	   --manpage
	      Output program man page
       -B, --margin-bottom <unitreal>
	      Set the page bottom margin (default 10mm)
       -L, --margin-left <unitreal>
	      Set the page left margin (default 10mm)
       -R, --margin-right <unitreal>
	      Set the page right margin (default 10mm)
       -T, --margin-top <unitreal>
	      Set the page top margin (default 10mm)
	   --minimum-font-size <int>
	      Minimum font size
	   --no-background
	      Do not print background
       -O, --orientation <orientation>
	      Set orientation to Landscape or Portrait
	   --page-height <unitreal>
	      Page height (default unit millimeter)
       -s, --page-size <size>
	      Set paper size to: A4, Letter, etc.
	   --page-width <unitreal>
	      Page width  (default unit millimeter)
	   --password <password>
	      HTTP Authentication password
	   --post <name> <value>
	      Add an additional post field (repeatable)
	   --post-file <name> <path>
	      Post an additional file (repeatable)
       -p, --proxy <proxy>
	      Use a proxy
       -q, --quiet
	      Be less verbose
	   --read-args-from-stdin
	      Read command line arguments from stdin
	   --readme
	      Output program readme
	   --redirect-delay <msec>
	      Wait some milliseconds for js-redirects
	   --stop-slow-scripts
	      Stop slow running javascripts
	   --title <text>
	      The title of the generated pdf file (The title of the first document is used if not specified)
	   --user-style-sheet <url>
	      Specify a user style sheet, to load with every page
	   --username <username>
	      HTTP Authentication username
       -V, --version
	      Output version information an exit
	   --zoom <float>
	      Use this zoom factor

Reduced Functionality
       This version of wkhtmltopdf has been compiled against a version of QT without the wkhtmltopdf patches. Therefore some features are missing,
       if you need these features please use the static version.

       Currently the list of features only supported with patch QT includes:

	* Printing more then one HTML document into a PDF file.
	* Running without an X11 server.
	* Adding a document outline to the PDF file.
	* Adding headers and footers to the PDF file.
	* Generating a table of contents.
	* Adding links in the generated PDF file.
	* Printing using the screen media-type.
	* Disabling the smart shrink feature of webkit.

Page sizes
       The default page size of the rendered document is A4, but using this --page-size optionthis can be changed to almost  anything  else,  such
       as: A3, Letter and Legal.  For a full list of supported pages sizes please see <http://doc.trolltech.com/4.6/qprinter.html#PageSize-enum>.

       For a more fine grained control over the page size the --page-height and --page-width options may be used

Reading arguments from stdin
       If  you	need  to  convert  a  lot  of  pages  in  a batch, and you feel that wkhtmltopdf is a bit to slow to start up, then you should try
       --read-args-from-stdin,

       When --read-args-from-stdin each line of input sent to wkhtmltopdf on stdin will act as a separate  invocation  of  wkhtmltopdf,  with  the
       arguments specified on the given line combined with the arguments given to wkhtmltopdf

       For example one could do the following:

	 echo "http://doc.trolltech.com/4.5/qapplication.html qapplication.pdf" >> cmds
	 echo "--cover google.com http://en.wikipedia.org/wiki/Qt_(toolkit) qt.pdf" >> cmds
	 wkhtmltopdf --read-args-from-stdin --book < cmds

Page Breaking
       The  current  page  breaking algorithm of WebKit leaves much to be desired. Basically webkit will render everything into one long page, and
       then cut it up into pages. This means that if you have two columns of text where one is vertically shifted by half a line. Then webkit will
       cut a line into to pieces display the top half on one page. And the bottom half on another page. It will also break image in two and so on.
       If you are using the patched version of QT you can use the CSS page-break-inside property to remedy this somewhat. There is no  easy  solu-
       tion  to  this  problem, until this is solved try organising your HTML documents such that it contains many lines on which pages can be cut
       cleanly.

       See   also:   <http://code.google.com/p/wkhtmltopdf/issues/detail?id=9>,   <http://code.google.com/p/wkhtmltopdf/issues/detail?id=33>   and
       <http://code.google.com/p/wkhtmltopdf/issues/detail?id=57>.

Contact
       If  you	experience  bugs  or want to request new features please visit <http://code.google.com/p/wkhtmltopdf/issues/list>, if you have any
       problems or comments please feel free to contact me: see <http://www.madalgo.au.dk/~jakobt/#about>

Authors
       Written by Jakob Truelsen. Patches by Mario Silva, Benoit Garret and Emmanuel Bouthenot.

								 2009 February 23						    WKHTMLTOPDF(1)
All times are GMT -4. The time now is 10:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy