Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8275397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:04:05+00:00 2026-06-08T08:04:05+00:00

From: http://www.utdallas.edu/~kcooper/teaching/5375/fall08/Tutorial8/tutorial8.htm (Section "Difference between bash sleep and sleep in C program"): There is

  • 0

From: http://www.utdallas.edu/~kcooper/teaching/5375/fall08/Tutorial8/tutorial8.htm

(Section "Difference between bash sleep and sleep in C program"):

There is a major difference between how bash sleep command and sleep function of C program works. The sleep function of C programs is a simple function call. When called, it gives up the CPU to the operating system so that it can schedule other processes which need CPU. Then after the specified amount of seconds, the process which called sleep starts working again.

The sleep command bash works differently. When this command is invoked, it creates a child process of itself. It runs for the specified amount of seconds and then exits back to the calling process.

  1. Why does bash sleep so complicated? (Why does bash sleep is realized through the forking?)
  2. Why bash sleep can’t be like C sleep?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:04:06+00:00Added an answer on June 8, 2026 at 8:04 am

    Why does bash sleep so complicated? (Why does bash sleep is realized through the forking?

    Because that’s what bash does, it runs programs (which on unixes is done through fork()/exec() ) It so just happens that someone wrote a program, /bin/sleep which just sleeps for the specified amount of seconds.

    Why bash sleep can’t be like C sleep?

    It could, if someone implemented sleep as a built in command/function to bash, but no-one has yet, and likely the benefit is not worth it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From http://www.doc.ic.ac.uk/teaching/projects/Distinguished03/AndrewSuffield.pdf : #include <string.h> struct x { char s[10]; int a[4]; }; void
From http://www.cse.ohio-state.edu/~gurari/theory-bk/theory-bk-twoli1.html#30007-23021r2.2.4 : Let M = <Q, Σ, Δ, δ, q 0 , F>
From http://www.coderanch.com/t/381676/java/java/number-months-between-two-given , one post mentioned: public static int monthsBetween(Date minuend, Date subtrahend) {
Taken from http://www.ocf.berkeley.edu/~wwu/riddles/cs.shtml It looks very compiler specific to me. Don't know where to
I download the httpmime.jar from http://www.java2s.com/Code/Jar/h/Downloadhttpmimejar.htm I put httpmime.jar in the folder of jre7/lib/ext/
After reading monkeytalk faq from http://www.gorillalogic.com/testing-tools/monkeytalk/documentation/monkeytalk-faq : How does it all work? MonkeyTalk is
I download FFMPEG from http://www.videohelp.com/tools/ffmpeg#download and saved it in my c:\program files\ffmpeg (Windows Vista).
this is copied from http://www.zenspider.com/ZSS/Products/RubyInline/Readme.html , the home of rubyinline, adding/moding as indicated in
I used the code from http://www.rgagnon.com/javadetails/java-0580.html to get Motherboard Id, but the result is
I wish to capture data from http://www.kitco.com/texten/texten.html : <html> <head> <title>Text Only Market Page</title>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.