From owner-freebsd-questions Fri May 30 06:57:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id GAA16515 for questions-outgoing; Fri, 30 May 1997 06:57:28 -0700 (PDT) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA16415 for ; Fri, 30 May 1997 06:56:20 -0700 (PDT) Received: by mail.EUnet.hu, id PAA11513; Fri, 30 May 1997 15:55:51 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id QAA00376; Wed, 28 May 1997 16:25:50 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199705281425.QAA00376@CoDe.hu> Subject: Re: nice To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Wed, 28 May 1997 16:25:49 +0200 (MET DST) Cc: ahill@interconnect.com.au In-Reply-To: from Anthony Hill at "May 28, 97 02:04:39 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > On Tue, 27 May 1997, Wayne Baety wrote: > > > > > Is there a way to have all of a users programs automatically run at a > > certain nice level? > > I havent tried this but maybe you could nice the shell the user is > dropped into at login time by changing his passwd file. ie set his shell > to /usr/bin/nice -5 /usr/bin/sh Hm. Change his/her shell to an executable script, which contains this line. In your way, you get: "/usr/bin/nice -5 /usr/bin/sh": no shell - or something like this But: what about this one: in /etc/profile (or in /etc/csh.login) make a big case (switch) statement, eg: case "$LOGNAME" in # maybe use "$USER" user1withLowPrio|user2withLowPrio|...) # the users, who need lower priority renice -p $$ ;; *) # anybody else : nothing, only for convenience ;; esac That's it. Gabor -- #!/bin/ksh Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"