Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Computer Support > Unix question.

Reply
Thread Tools

Unix question.

 
 
Knut Arvid Keilen
Guest
Posts: n/a
 
      09-22-2006
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.


 
Reply With Quote
 
 
 
 
samuel
Guest
Posts: n/a
 
      09-22-2006
"Knut Arvid Keilen" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

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


 
Reply With Quote
 
 
 
 
Walter Mautner
Guest
Posts: n/a
 
      09-22-2006
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]
 
Reply With Quote
 
Whiskers
Guest
Posts: n/a
 
      09-22-2006
On 2006-09-22, Knut Arvid Keilen <(E-Mail Removed)> 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
-- ~~~~~~~~~~
 
Reply With Quote
 
Vanguard
Guest
Posts: n/a
 
      09-23-2006
"Knut Arvid Keilen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C Programming 18 01-10-2005 03:35 AM
compile C programs with UNIX system calls (= Unix Programs??) jrefactors@hotmail.com C++ 12 01-10-2005 03:35 AM
How can I call a script on UNIX with VC.net David ASP .Net 1 11-09-2004 05:00 AM
my own perl "dos->unix"/"unix->dos" Robert Wallace Perl Misc 7 01-22-2004 10:59 PM
Accessing .Net web application from UNIX Tony Baker ASP .Net 2 09-30-2003 06:16 PM



Advertisments