Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Systems > Linux / BSD / OS X
User Name
Password

Reply
 
LinkBack Thread Tools Display Modes
Old 12-11-2005, 11:17 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
the nice command

Code:
# nice shellscript.sh
nice is used to modify the priority in which your script runs. negative values are greater priority, and positive values are lower priority.

i'm wondering what the default priority is if i just execute the command above with no number.

next question:

let's say this shell script has things like mysqldump or other commands in it, .. is every process that this shell script executes going to be run with the modified priorities as well?
__________________
sde is offline   Reply With Quote
Old 12-12-2005, 01:31 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
default value is 10, there are something with shell-scripts not accepting nice within... but shellscripts run with the nice command will let every command performed by the shell-script beeing handled by nice, nice +10, for a nicer nice value than default 10
else ~> info coreutils nice
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 12-12-2005, 07:43 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
Quote:
there are something with shell-scripts not accepting nice within... but shellscripts run with the nice command will let every command performed by the shell-script beeing handled by nice
so most of the time it will run the nice command within the script?

thanks for the info. this is what i needed to know =)
__________________
sde is offline   Reply With Quote
Old 12-12-2005, 12:43 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
The thing is, that some scripting environment provides their own enterpritation of the key "nice" so if you have your script ie:
Code:
#!/bin/sh nice my_command nice -n 12 my_other_command
you can't be sure the two commands will be run with the available nice program provided by the system because the scripting-shell in question might enterpret the word nice differently than just running the nice command.
But if you have something like:
Code:
!#/bin/sh my_command my_other_command
and run it with:
~ > nice my_script.sh
It will be sure to run my_command and my_other_command with the nice value the nice execution of the script is told.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 12-12-2005, 12:44 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
great thanks a lot. i'm gonna use it on my backup scripts to they don't bog down the server.
__________________
sde is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
big command line programs... smckittr Program Design and Methods 3 08-25-2005 09:52 PM
Command Line in VC++ roadkill Platform/API C++ 0 02-25-2005 11:52 AM
Input from command line Kportertx Java 7 07-15-2003 06:34 AM
force delete from command line sde Windows 4 04-24-2003 12:14 PM
Understanding Cron bdl Linux 0 02-16-2003 01:58 PM


All times are GMT -8. The time now is 10:32 PM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle