grep being cropped - WeOnlyDo Discussion board

grep being cropped (wodSSH / wodSSH.NET)

by mike_mort, Saturday, August 02, 2008, 13:23 (5958 days ago)

I have connected to the server and am wanting to place a new public ket within the authorized_keys file. I am first trying to see whether the new key already exists so that I am not duplicating this within the file.

My code is:

[code]
myCommand = grep ' & frmMainForm.txtOldPublicKey.Text & ' $HOME/.ssh/authorized_keys
tmpString = sshConnection.Execute(myCommand, regex:[$ #>] , 30)
[/code]

When I execute the command it seperates the $HOME/.ssh/authorized_keys and so I dont get the desired result.

In essense it executes grep 'command'. Then when I do a sshConnection.Recieve it shows $HOME/.ssh/authorized_keys. Any help appreciated.


Complete thread: