Please use a "here doc" for write:

```
(bin/'drush').write <<-EOS.undent
  #/bin/sh
  stuff goes here
EOS
```

The explicit `chmod` shouldn't be needed as the "linking" step should identify this as a shell script and add +x.