Article 6EMXA why it becomes if [ "" = "1" ]; then when the problem is fixed ?

why it becomes if [ "" = "1" ]; then when the problem is fixed ?

by
tangara
from LinuxQuestions.org on (#6EMXA)
i refer to the tutorial on staying out of trouble

http://linuxcommand.org/lc3_wss0090.php

i do not understand why when you fix the problem on line 5, then

Now when the shell performs the expansion it will see:

if [ "" = "1" ]; then

I can't wrap around my head why when the line is changed to if [ "$number" = "1" ]; then the shell will see it to be [ "" = "1" ];

Furthermore, when it is else, shouldn't it be using "" = "1" or the number != "1" so why it is still ["$number" = "1"] which is same as the condition on line 3 ?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments