Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Computer Support (http://www.velocityreviews.com/forums/f33-computer-support.html)
-   -   Unix question. (http://www.velocityreviews.com/forums/t475997-unix-question.html)

Knut Arvid Keilen 09-22-2006 01:20 AM

Unix question.
 
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.



samuel 09-22-2006 04:15 AM

Re: Unix question.
 
"Knut Arvid Keilen" <knutkeilen@hotmail.com> wrote in
news:56mdnY1sMJ_Up47YRVn_vA@telenor.com:

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



Walter Mautner 09-22-2006 11:09 AM

Re: Unix question.
 
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]

Whiskers 09-22-2006 01:01 PM

Re: Unix question.
 
On 2006-09-22, Knut Arvid Keilen <knutkeilen@hotmail.com> 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
-- ~~~~~~~~~~

Vanguard 09-23-2006 12:03 AM

Re: Unix question.
 
"Knut Arvid Keilen" <knutkeilen@hotmail.com> wrote in message
news:56mdnY1sMJ_Up47YRVn_vA@telenor.com...
>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.



All times are GMT. The time now is 02:51 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.