Bug 196232

Summary: csh/tcsh builtin nice command not compatible with nice(1)
Product: Base System Reporter: Christopher Forgeron <chris>
Component: binAssignee: freebsd-doc (Nobody) <doc>
Status: New ---    
Severity: Affects Many People CC: emaste
Priority: ---    
Version: 10.1-RELEASE   
Hardware: Any   
OS: Any   

Description Christopher Forgeron 2014-12-23 17:48:14 UTC
When you type 'man nice' on a 9.1-RELEASE or a 10.1-RELEASE, you are given a few examples, none which work. 

First Example: nice -n 5 date

Running this produces:

nice: Badly formed number.

Additionally, it lists an example of  "nice -n 16 nice -n -35 date" which also doesn't work.

Lastly, nice itself may be buggy. I haven't needed to use it in years, but it seems that it doesn't work as expected. Here's me trying a few commands.

nice -20 date - Works
nice 20 date - 20: Command not found.
nice -n 20 date - nice: Badly formed number.
nice -n20 date - nice: Badly formed number.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2014-12-23 20:43:50 UTC
It's not clear from your report but my guess is that you're using csh/tcsh and are thus using the built-in nice, which does not accept -n.

zsh:

% which nice
/usr/bin/nice
% nice -n 20 date
Tue Dec 23 20:41:44 UTC 2014

tcsh:

> which nice
nice: shell built-in command.
> nice -n 20 date
nice: Badly formed number.

Have a look at the builtin(1) manual page.
Comment 2 Christopher Forgeron 2014-12-23 21:03:42 UTC
Very True! 

I've only recently started using the default FreeBSD installed shell, so I didn't realize my mistake. Obviously before my shell didn't have a 'nice' builtin. 

I should have googled first, but it looked so obvious.

I even see the line now in 'man nice' about "Some shells may provide a builtin nice command" but it didn't register with me.

Ah, unless you can think of any way to save other people from falling into this same condition, I guess this is closable.
Comment 3 Andriy Gapon freebsd_committer freebsd_triage 2014-12-23 22:18:10 UTC
Usefulness of (t)csh nice builtin is questionable in any case. Especially given that it is not standards and FreeBSD nice compatible.
Comment 4 Christopher Forgeron 2014-12-23 22:33:32 UTC
Agreed - I'd love to see it depreciated, but I assume that falls into the 'it will break the world' type scenario - Or are we finally ready to upgrade from 1970's t/csh design?

Alternately, what about defaulting to a full-featured shell like zsh, or even standardizing FreeBSD on a new shell that is the default? Those who need it can use the old standard shells, the rest of us can move forward on a modern shell design that makes sense for today.  

Then again, I suppose that's a 2 year debate that no one really wants to start. :-)
Comment 5 Glen Barber freebsd_committer freebsd_triage 2015-07-08 14:10:40 UTC
Reclassifying this as a documentation bug.