Sponsored Content
Full Discussion: Shell Script average runtime
Homework and Emergencies Homework & Coursework Questions Shell Script average runtime Post 302563931 by navlelo on Wednesday 12th of October 2011 12:42:38 PM
Old 10-12-2011
0:00.05 (elapsed) indeed, forgot the space there. changed it to "%E" to only get the numbers.

---------- Post updated at 11:42 AM ---------- Previous update was at 11:22 AM ----------

Code:
#!/bin/bash
(
echo "("
for I in {1..5}
do
/usr/bin/time -f "%E"  ~/oblig1/oblig1a.sh 2>&1
done | while IFS=":." read MIN SEC TENTH
do
echo "( ( $MIN * 60) * $SEC ) +"
done
echo "0 )"
echo "/ 100"
) | bc

getting standard_in errors tho, syntax error and variable occurances of illegal character. :/

Code:
(standard_in) 1689: illegal character: L
(standard_in) 1689: syntax error
(standard_in) 1689: illegal character: K
(standard_in) 1689: syntax error
(standard_in) 1689: syntax error
(standard_in) 1690: illegal character: S
(standard_in) 1690: syntax error
(standard_in) 1691: syntax error
(standard_in) 1692: illegal character: K
(standard_in) 1692: syntax error
(standard_in) 1693: syntax error
(standard_in) 1694: syntax error
(standard_in) 1694: syntax error
(standard_in) 1695: syntax error
(standard_in) 1696: syntax error
(standard_in) 1696: syntax error
(standard_in) 1696: syntax error
(standard_in) 1697: illegal character: L
(standard_in) 1697: illegal character: \370
(standard_in) 1697: syntax error
(standard_in) 1697: syntax error
(standard_in) 1698: syntax error
(standard_in) 1698: syntax error
(standard_in) 1699: illegal character: H
... and the list goes on for ages

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

korn shell version at runtime?

How can I check what kornshell version I am using at runtime from within a kornshell script? (3 Replies)
Discussion started by: qanda
3 Replies

2. Shell Programming and Scripting

pass runtime parm to at -f shell script

Hi Folks... I am using a ksh script to submit the at command to run a shell script for immediate execution. The shell script requries 1 parameter. Command in the script is at -m -f $EXE_DIR/process_server.sh $START_TIME $DB_NAME where START_TIME=now and DB_NAME= tnsname of Oracle... (1 Reply)
Discussion started by: island360
1 Replies

3. AIX

allocate memory for shell script at runtime during execution--urgent critical help!!

How to allocate memory for a shell script on aix box at the time of execution i.e at runtime Are there any commands for AIX in specific Thanks in Advance (1 Reply)
Discussion started by: aixjadoo
1 Replies

4. UNIX for Dummies Questions & Answers

allocate memory for a shell script at runtime--urgent critical help!!!

How to allocate memory for a shell script on aix box at the time of execution i.e at runtime Are there any commands for AIX in specific Thanks in Advance (3 Replies)
Discussion started by: aixjadoo
3 Replies

5. UNIX for Advanced & Expert Users

Allocate memory for a shell script in Aix at runtime-urgent critical

How to allocate memory for a shell script on aix box at the time of execution i.e at runtime Are there any commands for AIX in specific Thanks in Advance (1 Reply)
Discussion started by: aixjadoo
1 Replies

6. Shell Programming and Scripting

passing runtime arguments to a shell script...

hi I am new to shell programming.....my question is while running one of my shell program it stops in between to accept input from the user and proceeds furthur after giving input....I want to know whether I can set this input through some files so that the shell acript reads the input from the... (10 Replies)
Discussion started by: santy
10 Replies

7. Shell Programming and Scripting

Shell Runtime Statistics

Hi, I am trying to capture runtime stats of a shell script (c shell). Are there system variables to call? Or should I create a date variable at the start of the script and at the end of the script? I am trying to capture the time if the script stops or ends with error. Please help. ... (4 Replies)
Discussion started by: CKT_newbie88
4 Replies

8. Shell Programming and Scripting

shell script for finding average runtime of other script

so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies

9. Shell Programming and Scripting

Shell or awk script to compute average of all the points within a circle

HI Help, I have a file which looks like below --- Input file ---> 1970113.00000 3460.00000 1.09516 1970116.00000 3791.00000 1.06350 1970120.00000 4120.00000 1.07588 1970115.00000 4450.00000 1.09591 1970116.00000 4780.00000 1.09965 1970120.00000 5109.00000 1.06733 ... (7 Replies)
Discussion started by: Indra2011
7 Replies

10. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
CONVICKT(1)						      General Commands Manual						       CONVICKT(1)

NAME
convickt - convert INTERCAL files between formats SYNOPSIS
convickt incharset outcharset [paddingrule [arrayname]] DESCRIPTION
This manual page describes the convickt command. Fuller documentation is available via the command info convickt convickt converts INTERCAL programs from one character set to another; it takes input from standard input and sends its output to standard output. OPTIONS
For incharset and outcharset atari Interpret the input as being ASCII-7 Atari syntax INTERCAL, as is used by the Atari INTERCAL-72 compiler, J-INTERCAL, and C-INTERCAL default syntax, or output in that syntax. baudot Interpret the input as being in CLC-INTERCAL's extended Baudot syntax, or output in that syntax. ebcdic Interpret the input as being in the CLC-INTERCAL dialect of EBCDIC, or output in that syntax. latin1 Interpret the input as being Latin-1 Princeton syntax INTERCAL, as is used by default by CLC-INTERCAL and also readable by C-INTER- CAL with the -X switch, or output in that syntax. For paddingrule zero Pad the irrelevant bits in ASCII-7 and Baudot output with zeros. printable Set the values of the irrelevant bits in ASCII-7 and Baudot output to try to cause the output to stay within character range 32-126. This option is the default. (Note that paddingrule is irrelevant for 8-bit character sets like Latin-1 and EBCDIC). random Pad the irrelevant bits in ASCII-7 and Baudot output with random data, except that outputing an all-bits-zero octet is avoided. CAVEATS
Not all conversions are possible, due to the character sets having different characters available. In most cases, an unconvertible or invalid character will be converted to a 0 (padded appropriately); the exception is that if a tab cannot be converted, it will instead be converted to a single space (so that INTERCAL programs still run if converted to Baudot). Using atari as an input or output character set will literally convert characters which differ between Atari and Princeton syntax without checking to see whether they are being used as operators or not. If arrayname is given, then instead of outputting the converted text literally, it will be output as portable (that is, legal in INTER- CAL-72, C-INTERCAL, J-INTERCAL and CLC-INTERCAL) INTERCAL that dimensions the tail array given as arrayname and assigns each byte of the output to an element of that array; this is mostly useful for producing Baudot text for CLC-INTERCAL-style array IO. AUTHOR
convickt and this manual page were written by Alex Smith. CONVICKT(1)
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy