Multiple If conditions

I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block?

Can you post the script so we can look at it?

Editors and IDE (Interactive development environment) usually support if-then-else blocking. Example editors: geany, notepad++, ultraedit Example IDE: eclipse

You need an editor that is syntax aware. I use ultraedit. It has a special file that allows you to specify reserved words and so on. You normally do not have to mess with the file just download the components for your own file. In your case bash, I guess.

I am using Notepad++ and How to get begin and start of a particular if block using this one if it is nested.

You can create a virtual stack in your mind and then read through the code. Everytime there's an if, you make a push; and everytime there's a fi, you make a pop from that virtual stack. At the end of this exercise, you would've attained your goal :stuck_out_tongue:

Any Input on this really appreciated

You have a script in an unspecified language with nested if statements. How you find the end of an if in awk . csh , a Bourne shell derivative, C or C++ . FORTRAN , perl , python , or some other language depends on what language you're using and the coding style of the person whose code you're examining.

Would you care to share any more information about what you're dealing with so we might have a chance of helping you?