• Post Reply Bookmark Topic Watch Topic
  • New Topic

Semi Colon ";"usage in if statement  RSS feed

 
Sham Jowsaki
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
What is the use of ";" in If statement
If [ "$X" = "$Y" ];
Pls explain me.
thanks
Jowsaki
[ June 11, 2003: Message edited by: Sham Jowsaki ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12156
256
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jowsaki
The semicolon in any unix command line allows multiple commands to be appended on one physical line.
So my example:is on one line. If I didnt use semicolons to break the commands, I would have had to use three lines:
Regards, Andrew
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In defiance of all logic, the shell doesn't have and if/then statement. Instead, you follow an if statement by a then statement!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!