I am trying to run this command on MacOSX terminal , which was initially intended to run on Linux

sed '1 i VISPATH=/mnt/local/gdrive/public/3DVis' init.txt >> ~/.bash_profile

but it gives me the error:

command i expects \ followed by text. 

is there any way I could modify the above command to work on MacOSX terminal

Edit
Report