Which of the following is not a valid variable name?

  • Post author:
  • Post category:Blog
  • Post last modified:September 22, 2023
  • Reading time:1 mins read

Which of the following is not a valid variable name?

  • NEWVARIABLE
  • VAR_1
  • _LPIC
  • 2_VAR
Explanation & Hint:

The variable name “2_VAR” is not a valid variable name. In many programming languages and shell environments, variable names cannot start with a number. Therefore, “2_VAR” is not a valid variable name, while the other options (“NEWVARIABLE,” “VAR_1,” and “_LPIC”) are valid variable names.

For more Questions and Answers:

NDG Introduction to Linux II 2.21 | Chapter 1: Advanced Shell Features Exam Answers