Can anyone explain difference between declare and typeset  with real life examples .
What is the difference between declare and typeset
bash;shell;typeset
In bash, typeset and declare are exactly the same. The only difference is that typeset is considered obsolete.typeset: typeset [-aAfFgilrtux] [-p] name[=value] ...    Set variable values and attributes.    Obsolete.  See `help declare'.The man page even lists them in the same breath:declare [-aAfFgilrtux] [-p] [name[=value] ...]typeset [-aAfFgilrtux] [-p] [name[=value] ...]    Declare variables and/or give them attributes.typeset is portable to some other shells, for example, ksh93. If you are aiming for cross-shell portability, use typeset (and make sure that the way you are calling it is portable). If you don't care about such portability, use declare.