Question: ```
selection=

until [ "$selection" = "0" ]; do

  echo ""
  echo "PROGRAM MENU"
  echo "1 - display free disk space"
  echo "2 - display free memory"
  echo ""
  echo "0 - exit program"
  echo ""
  echo -n "Enter selection: "
  read selection
  echo ""
  case $selection in
      1 ) df ;;
      2 ) free ;;
      0 ) exit ;;
      * ) echo "Please enter 1, 2, or 0"
  esac
echo $selection

done

```

If I press 2 it's showing free space and echo is showing 2, but I need echo is "free".

Answer: 
You can't. The selection is used by the case statement to decide what to do. It is not set by the case statement.

You might want to try something like this instead:

```
selection=

until [ "$selection" = "0" ]; do

  cmd=''

  echo ""
  echo "PROGRAM MENU"
  echo "1 - display free disk space"
  echo "2 - display free memory"
  echo ""
  echo "0 - exit program"
  echo ""
  echo -n "Enter selection: "
  read selection
  echo ""

  case "$selection" in
      1) cmd='df' ;;
      2) cmd='free' ;;
      0) cmd='exit' ;;
      *) echo "Please enter 1, 2, or 0"
  esac

  if [ -n "$cmd" ] ; then 
    echo "selection $selection is '$cmd'"
    $cmd
  fi

done

```

Note that it runs the `echo "selection $selection is '$cmd'` before executing `$cmd`, otherwise it will exit before the `echo` when `$selection` is 0.
Here is how I would do this. Might be helpful/instructive.

```
#!/bin/bash

menu() {
  cat >&2 <<EOF

PROGRAM MENU

1 - display free disk space
2 - display free memory

0 - exit program

EOF
}

while true; do
  menu
  read -p "Enter selection: " selection
  case "$selection" in
    1)
      echo df
      df
      ;;
    2)
      echo free
      free
      ;;
    0)
      echo exit
      exit
      ;;
    *)
      echo "Please enter 1, 2 or 0" >&2
      ;;
  esac
done

```