In shell scripting, the 'set' command is used to define and assign values to shell variables. The setenv command is used in C-shell (csh) for environment variables, not sh/bash. setexp and unset are not variable definition commands (unset removes variables).