Hello, I have made a Linux Shell Script that downloads 6 files from the Internet and then deletes them. Now i want to use the function "/usr/bin/time" and "bc" to calculate how long the avergate run time for the shell script is. I therefore need to do it 100 times. My shell script code is below:
There's no /usr/bin/time on my or most systems. 'time' is generally a shell builtin.
It also doesn't output data in a format very amenable to processing.
Since you have BASH you have the seconds variable.
Also: wget can download more than one file at once, and rm can delete more than one file at once. If you use wget on several files at once it's much faster, since you don't need to disconnect and reconnect for each individual file. You can get rid of your original for-loop completely:
My task
Create a shell script for bash(1), which calculates the average turnaround for
the script. The incision should be based on one hundred runs. For measurement of sciptets turnaround use time(1). For calculating
the average turnaround use bc(1)
Quote:
The bash has a built-in command called 'time'. For the bash script you create to use gnu version, you must enter the path to this program, rather than just 'time', or the embedded version is used. Which command (1) can be used to find the path to commands.
We have a homework forum and homework rules, which you're not in and not following, respectively. Please post in the homework forum, and please obey its rules. We can't help you until you do.
I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries.
I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble:
$ ./autogen.sh
checking... (2 Replies)
I want to have a script both define functions and have the ability to run an external program calling one of them. This is the simplified construct:
#!/bin/bash
foo() {
echo "this is foo"
}
bar() {
echo "this is bar"
}
case "$1" in
one)
foo
;;
two)
export... (1 Reply)
Legends,
I am not able to set "expr" function in ksh script.
Below is the sample code i used, and output is as "Syntax error"
Please help me to come out of it.
OUTPUT (9 Replies)
Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself.
But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Hi all,
below is the problem details:
ora10g@CNORACLE1>which ld
/usr/ucb/ld
ora10g@CNORACLE1>cd /usr/ccs/bin
ora10g@CNORACLE1>ln -s /usr/ucb/ld ld
ln: cannot create ld: File exists
ora10g@CNORACLE1>
how to link it to /usr/ccs/bin? (6 Replies)
I wondered if someone could point out the differences between the time commmand and usr/bin/time and the accuracy one might have over another.
Also, is there a website or two a person could maybe link for me to describe the differences?
Thank you for your time. (2 Replies)
thanks for your recent post. i have this command /usr/bin/time find /usr -name socket.h -print/usr/bin/time find /usr -name socket.h -print which i have ran on my personal linux machine. I dont know how to interpret this command...does it mean that find the names in the usr directory and print it... (1 Reply)
I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)