Hello there, I am trying to create a file with some text in it inside rules.d

Code:
sudo echo SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666", OWNER="mendhak" > /etc/udev/rules.d/51-android.rules
So I want to write that string to the 51-android.rules file. Whether or not I use sudo, the output is always


bash: /etc/udev/rules.d/51-android.rules: Permission denied
If I gksu gedit a file there, it works just fine and I can create it.


However, I'd like to be able to do this via a bash script. What am I missing?