Hi I am writing a custom function in linux that is designed to put four spaces after a comment indicator. I am unfamiliar with writing code in linux, I am more proficient in reading it rather than writing it out. the comments are signified with the ";" character. So far this is what I have in the draft. This is basic linux using putty for a bash emulator.

```
commentPlacer()
{

typeset -i count1=0  #iterator for first loop
typeset -i count2=0  #iterator for secod loop
len= ${#$1}  #length of argumnent
comment=";"
space= " "
comIndex=${$1#/;/}  #index of the comment
commentSpace= ";    "  #the comment indicator with the proper spacing

for(( count1; count1 <= len; count1++ ))  #loop to check if there is a comment on the line
    if [[ $1[count] == comment ]]
        for (( count2; count2 < $1[count1]; count2++ ))
                if [[ $1[count2] != commentSpace  ]]  #if the line doesn't have enough spacing in the comment use commentSpace variable 
                    then echo ${{$1:0:comIndex - 1} + commentSpace + {$1:commentSpace + 1: -1}} #cut off line before comment indicator and replace the line with the proper spacing.
                fi
        done
    fi
done
}

```

The code is meant to iterate through and argument, check to see if there is a `;` in the line and if there is it will put four spaces before the ';' to indicate the comment. The error I get is that the 'fi' on line 17 of the code is a syntax error. Again I'm more of a javascript coder, if someone could give me a point in right direction I would greatly appreciate it I am in the process of learning linux. The results should take the following code:

```
commentPlacer x="example" ;This line is a comment.

```

Reformatting it to look like this:

```
x="example"    ;This line is a comment.

```