Session and utilities
The typeset command
Like declare: declares variables and their attributes (same as declare).
Copy-ready examples
$ typeset X=1Declare a variableYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- It is the name used in ksh; in bash declare is usually preferred.
FAQ
What does typeset do?
It declares and types variables; in bash it is a synonym of declare.
Where is it used?
Mainly in ksh and bash scripts.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course