export vs env vs set commands

Hi

I'm trying to understand variable scopes in solaris10.
It is said that to display env variables we use 3 commands :

  • env
  • set
  • export

What is the difference between them ?

thx for help.

---------- Post updated at 11:00 AM ---------- Previous update was at 10:50 AM ----------

I understand this :

To list all shell vars with their current values perform set cmd.

# set
HOME=/root
HZ=
IFS=

LC_COLLATE=pl_PL.ISO8859-2
LC_CTYPE=pl_PL.ISO8859-2
LC_MESSAGES=C
LC_MONETARY=pl_PL.ISO8859-2
LC_NUMERIC=pl_PL.ISO8859-2
LC_TIME=pl_PL.ISO8859-2
LOCAL=local_variable
LOGNAME=root
MAIL=/var/mail/root
MAILCHECK=600
OPTIND=1
PATH=/usr/sbin:/usr/bin
PS1=#
PS2=>
REMOTE=remote_variable
SHELL=/sbin/sh
TERM=ansi
TZ=Poland

To make a value of variable known to a subshell export it using the export cmd.

# export
export LOGNAME
export PATH
export REMOTE

QUESTIONS
---------------
Now I understand the difference between set and export cmds but don't understand the meaning of env command ?
What does it mean to make a value of variable known to a sub-shell ?

[root@linux ~]# x=5                       <= here variable is set without export command
[root@linux ~]# echo $x
5
[root@linux ~]# bash                      <= subshell creation
[root@linux ~]# echo $x                   <= subshell doesnt know $x variable value

[root@linux ~]# exit                      <= exit from subshell
exit
[root@linux ~]# echo $x                   <= parent shell still knows $x variable
5
[root@linux ~]# export x=5                <= specify $x variable value using export command
[root@linux ~]# echo $x                   <= parent shell doesn't see any difference from the first declaration
5
[root@linux ~]# bash                      <= create subshell again
[root@linux ~]# echo $x                   <= now the subshell knows $x variable value
5
[root@linux ~]#

ok @bartus11 I understand now the difference but have one more question :

Command set shows all declared variables, command export shows only declared and exported variables but what shows env command ?