bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shouldn't "type" and "command" complain if there are no parameters?


From: Linda Walsh
Subject: Re: Shouldn't "type" and "command" complain if there are no parameters?
Date: Wed, 25 Apr 2012 18:50:55 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Victor Engmark wrote:

Re-post from 
<http://unix.stackexchange.com/questions/36752/why-are-parameters-to-bashs-command-and-type-optional>:

[T]hese commands print nothing and return exit code 0 if no parameters are 
provided. But [...] `help command` and `help type` both state that at least one 
parameter is mandatory. Is this a bug, a feature, or did I misunderstand 
something?



command executes the named argument as a command.

It is perfectly valid to type in nothing at the command line and expect
no error.

A similar argument like can be proposed for type.

You give it nothing as input, why would you expect output?

Conversely, would you want it to give you an error every time you
hit 'Enter' at the prompt?

it's similar to the annoyance caused by getting an error for unexpected ";"
when ";" is meant, in such context, to be taken for a line separator.
;-/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]