Results 1 to 2 of 2
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-11-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 1
/usr/bin/time Shell Scripting Function
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:
Code:#!/bin/bash #!/bin/bash/ for I in {1..6} do echo "Downloading file number $I " wget --user=os --password=yda htt!p://osyda50.hive.no/0$I.html echo "Deleting file number $I " rm 0$I.html done
- 10-12-2011 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,700
Must you use /usr/bin/time? I'd either just use Bash's built-in time function, or use date +%s before and after the loop, then calculate the difference.


Reply With Quote
