Session and utilities

The typeset command

Like declare: declares variables and their attributes (same as declare).

Syntax

typeset <nombre=valor>Try it in the terminal →

Copy-ready examples

$ typeset X=1Declare a variable

You 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.

Related commands

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