Unix question.

Discussion in 'Computer Support' started by Knut Arvid Keilen, Sep 22, 2006.

  1. I tried this a number of years ago as a student.

    In Unix there is a command with the name of Sleep.

    You can run the process either in the foreground by using the command Sleep
    x, which either locks up your system
    (when running as Unix at a / the console or at a low init mode) or you can
    run the process in the background using the command
    Sleep x $ or the like (It has become a number of years ago).

    The "x" is in seconds. Assume for example 10 for x . When running this using
    an ordinary Unix account, nothing particular happens during the
    time the process is running, but if you dare running it as a superuser
    (root), something strange may perhaps be observed when having a look at the
    process details (increase the "x" factor, giving you the time to have a
    look, or try it several times in a row).

    Anyone having a suggestion on this ? I am a little unsure.

    Thanks.
    Knut Arvid Keilen, Sep 22, 2006
    #1
    1. Advertising

  2. Knut Arvid Keilen

    samuel Guest

    "Knut Arvid Keilen" <> wrote in
    news::

    > I tried this a number of years ago as a student.
    >
    > In Unix there is a command with the name of Sleep.


    why not ask in a comp.unix

    group ??


    >
    > You can run the process either in the foreground by using the
    > command Sleep x, which either locks up your system
    > (when running as Unix at a / the console or at a low init
    > mode) or you can run the process in the background using the
    > command Sleep x $ or the like (It has become a number of years
    > ago).
    >
    > The "x" is in seconds. Assume for example 10 for x . When
    > running this using an ordinary Unix account, nothing
    > particular happens during the time the process is running, but
    > if you dare running it as a superuser (root), something
    > strange may perhaps be observed when having a look at the
    > process details (increase the "x" factor, giving you the time
    > to have a look, or try it several times in a row).
    >
    > Anyone having a suggestion on this ? I am a little unsure.
    >
    > Thanks.
    >
    >
    >
    samuel, Sep 22, 2006
    #2
    1. Advertising

  3. Knut Arvid Keilen enlightened us 24hoursupport.helpdesk-(ab)users with:

    > I tried this a number of years ago as a student.
    >
    > In Unix there is a command with the name of Sleep.
    >
    > You can run the process either in the foreground by using the command
    > Sleep x, which either locks up your system
    > (when running as Unix at a / the console or at a low init mode) or you


    It does not lock the system, just the shell or script it is used in.
    If it is applied within a init script, that one is halted until the
    specified time elapsed.

    > can run the process in the background using the command
    > Sleep x $ or the like (It has become a number of years ago).
    >

    "&" ... but for sleep that's pretty useless.

    > The "x" is in seconds. Assume for example 10 for x . When running this
    > using an ordinary Unix account, nothing particular happens during the
    > time the process is running, but if you dare running it as a superuser
    > (root), something strange may perhaps be observed when having a look
    > at the process details (increase the "x" factor, giving you the time
    > to have a look, or try it several times in a row).
    >

    Running it as root in a bash shell, having a look at "ps -ef" on another
    shell, I only see "bash" for that terminal. Tested with aix4.2,
    solaris10 and linux.
    --
    vista policy violation: Microsoft optical mouse found penguin patterns
    on mousepad. Partition scan in progress to remove offending
    incompatible products. Reactivate MS software.
    Linux 2.6.17-mm1,Xorg7.1/nvidia [LinuxCounter#295241,ICQ#4918962]
    Walter Mautner, Sep 22, 2006
    #3
  4. Knut Arvid Keilen

    Whiskers Guest

    On 2006-09-22, Knut Arvid Keilen <> wrote:
    > I tried this a number of years ago as a student.
    >
    > In Unix there is a command with the name of Sleep.
    >
    > You can run the process either in the foreground by using the command Sleep
    > x, which either locks up your system
    > (when running as Unix at a / the console or at a low init mode) or you can
    > run the process in the background using the command
    > Sleep x $ or the like (It has become a number of years ago).
    >
    > The "x" is in seconds. Assume for example 10 for x . When running this using
    > an ordinary Unix account, nothing particular happens during the
    > time the process is running, but if you dare running it as a superuser
    > (root), something strange may perhaps be observed when having a look at the
    > process details (increase the "x" factor, giving you the time to have a
    > look, or try it several times in a row).
    >
    > Anyone having a suggestion on this ? I am a little unsure.
    >
    > Thanks.


    See man sleep

    --
    -- ^^^^^^^^^^
    -- Whiskers
    -- ~~~~~~~~~~
    Whiskers, Sep 22, 2006
    #4
  5. Knut Arvid Keilen

    Vanguard Guest

    "Knut Arvid Keilen" <> wrote in message
    news:...
    >I tried this a number of years ago as a student.
    >
    > In Unix there is a command with the name of Sleep.
    >
    > You can run the process either in the foreground by using the
    > command Sleep x, which either locks up your system
    > (when running as Unix at a / the console or at a low init mode) or
    > you can run the process in the background using the command
    > Sleep x $ or the like (It has become a number of years ago).
    >
    > The "x" is in seconds. Assume for example 10 for x . When running
    > this using an ordinary Unix account, nothing particular happens
    > during the
    > time the process is running, but if you dare running it as a
    > superuser (root), something strange may perhaps be observed when
    > having a look at the
    > process details (increase the "x" factor, giving you the time to
    > have a look, or try it several times in a row).
    >
    > Anyone having a suggestion on this ? I am a little unsure.



    Was there actually a question buried in there somehwere (other than
    asking for a suggestion on a non-existent question)? "something
    strange may perhaps be observed". That was supposed to mean something
    to which someone else could address?

    To put a process in background, append the ampersand character ("&"),
    and in "sleep x &". But what would be the point of expending CPU
    cycles to pause a shell that is in the background unless you were
    using 'sleep' as part of a script (which is what you would put in the
    background and not the 'sleep' command since that returns immediately
    to the command prompt so the script would continue to run without
    waiting)?

    I think it's time for a "UNIX for Dummies" book for you to review.
    Too many years have passed.
    Vanguard, Sep 23, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3RvcmFnZSBlbmdpbmVlciB3aXRoIHF1ZXN0aW9u

    NFS shares (Windows to Unix) chown issues

    =?Utf-8?B?U3RvcmFnZSBlbmdpbmVlciB3aXRoIHF1ZXN0aW9u, Mar 17, 2005, in forum: Microsoft Certification
    Replies:
    0
    Views:
    1,855
    =?Utf-8?B?U3RvcmFnZSBlbmdpbmVlciB3aXRoIHF1ZXN0aW9u
    Mar 17, 2005
  2. Dan Mahoney

    Cisco-like Ping utility for Unix

    Dan Mahoney, Dec 11, 2003, in forum: Cisco
    Replies:
    2
    Views:
    1,083
    CiscoTech
    Dec 27, 2003
  3. dovelet
    Replies:
    2
    Views:
    666
    Adrian Grigorof
    May 9, 2004
  4. Replies:
    2
    Views:
    442
  5. Donald

    UNIX question

    Donald, Aug 12, 2005, in forum: Computer Support
    Replies:
    6
    Views:
    501
    Seatoller
    Aug 12, 2005
Loading...

Share This Page