On 27 July 2012 23:02, Jeremy Rottman <
rott...@gmail.com> wrote:
> I am working on a getting webistrano to work with git and deploy to an ec2
> server.
>
> The issue that I am having is since ssh_options can only have 1 key
> specified, I decided to just write a key to the servers on setup. However
> this is proving more difficult that previously expected.
>
> This is my current test method that I am working with. The issue that I am
> seeing is that then deploy_key is being written to a single line. Now I have
> tried adding '\n' at each line break but when the file is written out it
> adds a \ before each line break.
I do hope that private key isn't valuable ... :-)
Remember that 'run "echo blah > file"' is a bash command, and you need
to tell echo to respect escaped characters with "-e".
I suspect if you try enough combinations of inline newlines and flags
for echo, you'll find the solution.
You might be better off trying to shell out and create a file from a
variable's contents inside "irb" on your workstation, so you can
iterate through all the different permutations quickly without having
to do a web/cap run each time.
HTH,
Jonathan
--
Jonathan Matthews
Oxford, London, UK
http://www.jpluscplusm.com/contact.html