Sponsored Content
Top Forums Shell Programming and Scripting Optimizing script to reduce execution time Post 302994664 by SkySmart on Sunday 26th of March 2017 01:48:50 PM
Old 03-26-2017
Quote:
Originally Posted by RudiC
This gives an identical output - for any purpose whatsoever - in one awk statement:
Code:
awk -vFN="$FILENAME" '
BEGIN   {LFN = length(FN) + 1
         for (i=0; i<LFN-1; i++){EMPTY = sprintf ("u1u1.%*s", i*LFN, "")
                                 printf "%s\n%s%s%s\n%s\n", EMPTY, EMPTY, substr(FN, i+1, 1), EMPTY, EMPTY
                                }
        }
'

this is good enough for me. thank you very much!!!!
it is perfect!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script execution time calculation

I am writting a script in the ksh shell and am trying to find a way to report the total execution time of the script without requiring the user to specify the time function when executing the script. Does anyone have any examples they have used. I have been setting up two date variables (one at... (9 Replies)
Discussion started by: johnsonbryce
9 Replies

2. Shell Programming and Scripting

To reduce execution time

Hi All, The below script I run daily and it consumes 2 hours approx. In this I am calling another script and executing the same twice. Is the loop below the cause for the slow process?Is it possible to finetune the program so that it runs in a much faster way? The first script: #!/bin/ksh... (4 Replies)
Discussion started by: Sreejith_VK
4 Replies

3. Shell Programming and Scripting

time of execution of script

i want to test whether a script has been executed in last 15 days or not....please help how can i do this...is there any copmmand there to know timings of last execution of any script (8 Replies)
Discussion started by: arghya_owen
8 Replies

4. Shell Programming and Scripting

need inputs on how i can change my script to reduce amount of time the script takes

HI , I have a list1 which consists of data that i have to search and a list2 which has the files that need to be searched .So basically i am using list1 on list2 to see if list1 data is present if found replace it .I have written the code using foreach loop for each list .This is taking the... (1 Reply)
Discussion started by: madhul2002
1 Replies

5. Shell Programming and Scripting

get execution time of a script

Hi, I have a simple question. How can I get the execution time of a script and maybe put it in a variable? Another question. How can I get only time and not date and put it in a variable? I tried something with "date" command but with no success... If someone could help me... (8 Replies)
Discussion started by: Moumou
8 Replies

6. Shell Programming and Scripting

execution time / runtime -- bash script please help!

Hello, I'm running a bash script and I'd like to get more accurate a runtime information then now. So far I've been using this method: STARTM=`date -u "+%s"` ......... *script function.... ......... STOPM=`date -u "+%s"` RUNTIMEM=`expr $STOPM - $STARTM` if (($RUNTIMEM>59)); then... (6 Replies)
Discussion started by: TehOne
6 Replies

7. Shell Programming and Scripting

Automation script to reduce the installation time

DELETED. (0 Replies)
Discussion started by: vasuvv
0 Replies

8. Shell Programming and Scripting

Find execution time of script

i am using bash START=$(date +%s) END=$(date +%s) DIFF=$(echo "$END - $START" ) this code is not working (14 Replies)
Discussion started by: rafa_fed2
14 Replies

9. Shell Programming and Scripting

To take script execution time

Hello Guys, I would like to know is there a way to take the script execution time For e.g i am having a script.sh i need to write inside he script.sh like Start time : 10-Mar-2016 02:30:35 all code over here ... End time : 10-Mar-2016 03:30:32 Script start time - 02:30:35 ... (7 Replies)
Discussion started by: Master_Mind
7 Replies

10. Shell Programming and Scripting

Need to reduce the execution time

We are trying to execute below script for finding out the occurrence of a particular word in a log file Need suggestions to optimize the script. Test.log size - Approx to 500 to 600 MB $wc -l Test.log 16609852 Test.log po_numbers - 11 to 12k po's to search $more po_numbers xxx1335... (10 Replies)
Discussion started by: KumarPiyush7225
10 Replies
RABBIT(1)							      rabbit								 RABBIT(1)

NAME
rabbit - presentation tool using RD, simple text format SYNOPSIS
rabbit [options] [SOURCE_INFOS] DESCRIPTION
Theme -I, --include=PATH Add [PATH] to load path. -t, --theme=THEME Use [THEME] as theme. (default) --comment-theme=THEME Use [THEME] for comment. () --allotted-time=TIME Use [TIME] as allotted time. () Source -T, --type=TYPE Specify source type as [TYPE]. Select from [auto, argf, file, memory, slideshare, uri]. Note: case insensitive. (auto) When select ARGF specify none (get from STDIN) or [FILE_NAMES] as [SOURCE_INFOS]. When select File specify [FILENAME] as [SOURCE_INFOS]. When select Memory specify [FILENAME_OR_NOT] as [SOURCE_INFOS]. When select SlideShare specify [USER] and [TITLE] as [SOURCE_INFOS]. When select URI specify URI as [SOURCE_INFOS]. -e, --encoding=ENCODING Specify source encoding as [ENCODING]. (auto) -B, --base=BASE Specify base URI or path of source as [BASE]. (auto) Initial state -f, --[no-]full-screen Toggle full screen mode. (off) --[no-]index-mode Toggle index mode. (off) Size -g, --geometry=GEOMETRY Set window geometry [GEOMETRY]. Format: WIDTHxHEIGHT+X+Y (nil) -w, --width=WIDTH Set window width to [WIDTH]. (800) -h, --height=HEIGHT Set window height to [HEIGHT]. (600) -S, --size=WIDTH,HEIGHT Set window width and height to [WIDTH] and [HEIGHT]. (800,600) Save -s, --save-as-image Save as image and exit. -i, --saved-image-type=TYPE Specify saved image type as [TYPE]. (png) -bBASE_NAME, Specify saved image base name as [BASE_NAME]. --saved-image-base-name (Title of slide) --saved-image-basename --[no-]output-html Output HTML for viewing saved images. (false) --[no-]output-index-html Output index HTML for navigating slides. (false) --rss-base-uri=URI Specify base URI of RSS as [URI]. RSS is generated only when HTML is output. () --source-filename=FILENAME Specify source filenam as [FILENAME]. () Print -p, --print Print and exit. -o, --output-filename=FILENAME Specify printed out filename as [FILENAME]. (#{Title of slide}.pdf) --slides-per-page=SLIDES Set slides per page. (1) --[no-]draw-scaled-image Draw scaled image. Better look for displaying but lesser look for printing. (true) Paper --paper-width=WIDTH Set paper width to [WIDTH] Pt. (landscape A4 width) --paper-height=HEIGHT Set paper height to [HEIGHT] Pt. (landscape A4 height) --paper-size=WIDTH,HEIGHT Set paper width and height to [WIDTH] Pt and [HEIGHT] Pt. (landscape A4 size) Margin --margin-left=MARGIN Set left margin for slides per page mode print. (auto) --margin-right=MARGIN Set right margin for slides per page mode print. (auto) --margin-top=MARGIN Set top margin for slides per page mode print. (auto) --margin-bottom=MARGIN Set bottom margin for slides per page mode print. (auto) --margin={ [ALL] | [TOP_BOTTOM],[LEFT_RIGHT] | [TOP],[LEFT_RIGHT],[BOTTOM] | [TOP],[RIGHT],[BOTTOM],[LEFT]} Set margin for slides per page mode print. --page-margin-left=MARGIN Set left page margin. (auto) --page-margin-right=MARGIN Set right page margin. (auto) --page-margin-top=MARGIN Set top page margin. (auto) --page-margin-bottom=MARGIN Set bottom page margin. (auto) --page-margin={[ALL]|[TOP_BOTTOM],[LEFT_RIGHT]|[TOP],[LEFT_RIGHT],[BOTTOM]|[TOP],[RIGHT],[BOTTOM],[LEFT]} Set page margin. dRuby --[no-]use-druby Specify whether to use dRuby. (true) --druby-uri=URI Specify dRuby URI. (druby://127.0.0.1:10101) --[no-]output-druby-uri Specify whether to output dRuby URI. (false) SOAP --[no-]use-soap Specify whether to use SOAP. (false) --soap-host=HOST Specify SOAP host as [HOST]. (0.0.0.0) --soap-port=PORT Specify SOAP port as [PORT]. (10103) XML-RPC --[no-]use-xmlrpc Specify whether to use XML-RPC. (false) --xmlrpc-host=HOST Specify XML-RPC host as [HOST]. (0.0.0.0) --xmlrpc-port=PORT Specify XML-RPC port as [PORT]. (10104) Server --[no-]server Specify whether to run as server. (false) Public level --public-level=LEVEL Specify public level. Select from the following: [ strict, move, read-size, change-size, size, read-source, change-source, source, control, all ] (all) Comment --comment-source=FILE Deprecated. Just ignored. Specify initial comment source. (default source) --comment-encoding=ENCODING Deprecated. Just ignored. Specify comment source encoding. (auto) Migemo --migemo-dictionary-search-path=PATH1,PATH2,... Specify search paths for Migemo static dictionary. (/usr/share, /usr/local/share) --migemo-dictionary-name=NAME Specify static dictionary name for Migemo. (migemo-dict) 3D --[no-]use-gl Specify whether to use OpenGL if available. (false) Display --[no-]keep-above Specify whether to keep above window. (false) Others --[no-]show-native-window-id Show a native window ID of the Rabbit window if available. e.g. The ID is the ID of X resource on X window system. (false) Common options --locale-dir=DIR Specify locale dir as [DIR]. (auto) --logger-type=TYPE Specify logger type as [TYPE]. Select from [stderr, gui]. (STDERR) --log-level=LEVEL Specify log level as [LEVEL]. Select from [debug, info, warning, error, fatal, unknown]. (info) --help Show this message. --version Show version. rabbit 1.0.7 June 2012 RABBIT(1)
All times are GMT -4. The time now is 10:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy