Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Question /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:

    for I in {1..6}
            echo "Downloading file number $I "
            wget --user=os --password=yda htt!p://$I.html
            echo "Deleting file number $I "
            rm 0$I.html

  2. #2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts