mainThe GNU Bourne-Again SHell - Support: sr #109359, "help" lists...

 
 

sr #109359: "help" lists "variables" as one of shell builtins, but this is not true

Submitter:  Askar Safin <safinaskar>
Submitted:  Fri 21 Jul 2017 01:20:05 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Wont Do
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 21 Jul 2017 01:20:05 PM UTC, original submission:  

I use bash 4.4.12(1)-release (version reported by bash itself). Version reported by my distro (debian): 4.4-5.

When I type "help" into "bash" I see this:



GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                                                       history [-c] [-d offset] [n] or history -anrw [filename] or his>
 (( expression ))                                                   if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]..>
 . filename [arguments]                                             jobs [-lnprs] [jobspec ...] or jobs -x command [args]
 :                                                                  kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or k>
 [ arg... ]                                                         let arg [arg ...]
 [[ expression ]]                                                   local [option] name[=value] ...
 alias [-p] [name[=value] ... ]                                     logout [n]
 bg [job_spec ...]                                                  mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u f>
 bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [>  popd [-n] [+N | -N]
 break [n]                                                          printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]                                  pushd [-n] [+N | -N | dir]
 caller [expr]                                                      pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac         read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nch>
 cd [-L|[-P [-e]] [-@]] [dir]                                       readarray [-n count] [-O origin] [-s count] [-t] [-u fd] [-C ca>
 command [-pVv] command [arg ...]                                   readonly [-aAf] [name[=value] ...] or readonly -p
 compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G>  select NAME [in WORDS ... ;] do COMMANDS; done
 compopt [-o|+o option] [-DE] [name ...]                            set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
 continue [n]                                                       shift [n]
 coproc [NAME] command [redirections]                               shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilnrtux] [-p] [name[=value] ...]                    source filename [arguments]
 dirs [-clpv] [+N] [-N]                                             suspend [-f]
 disown [-h] [-ar] [jobspec ... | pid ...]                          test [expr]
 echo [-neE] [arg ...]                                              time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [name ...]                       times
 eval [arg ...]                                                     trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [arguments ...]] [redirection ...>   true
 exit [n]                                                           type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or export -p                       typeset [-aAfFgilnrtux] [-p] name[=value] ...
 false                                                              ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command>   umask [-p] [-S] [mode]
 fg [job_spec]                                                      unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done                       unset [-f] [-v] [-n] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done                      until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMANDS ; }             variables - Names and meanings of some shell variables
 getopts optstring name [arg]                                       wait [-n] [id ...]
 hash [-lr] [-p pathname] [-dt] [name ...]                          while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                                          { COMMANDS ; }
---

It seems that everything in this list is shell builtins and grammar constructions. Infortunately, this is not true. "variables" is not shell builtin. When I type "variables", I simply get "command not found". So "variables" got included in the list simply because it is help topic. So, please write about "variables" separately", for example, write it the end of list 'Also, you can see help on bash variables using "help variables"'. So, please double-check that all listed commands are really builtins (and bash syntactic constructions).

How I came to this? Well, I am developing very portable shell script not limited to bash. I need to know what builtins are always available to it. To do this, I took a list of shell builtins from different shells and tried to perform set-theoretic intersection of it. But then I suddenly noticed, that "variables" listed in list of bash builtins is not true builtin. You confused me.

Askar Safin <safinaskar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Updated the item)
  • -email is unavailable- added by safinaskar (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-03 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code