Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Problem with Executing SSH Command in vCO Workflow - break line \n guilty?

$
0
0

Hi,

I want to execute a SSHCommand within the vCO Appliance, to convert a Unix formatted CSV File (2 lines - header and properties) into Win format. I'm using the perl -p -e 's/\n/\r\n/' < unixfile.txt > winfile.txt command found here: https://kb.iu.edu/d/acux

The command itself runs flawlessly when I start it directly on the vCO Appliance console.

When use this script within the Workflow: mySSHCommand.executeCommand("perl -p -e 's/\n/\r\n/' < unixfile.txt > winfile.txt");  the output is not converted. I guess the reason for this is, that during execution, the '\n' is interpreted as break line and the whole command gets scrambled like this:

perl -p -e 's/

/

/'

I've tried using a string variable as the input for the command:

var SSHstring = "perl -p -e 's/\n/\r\n/' < unixfile.txt > winfile.txt"

mySSHCommand.executeCommand(var SSHstring);

This doesn't remove the problem.

Is it possbile to parse the command somehow, so that the whole string is executed in the vCO command line?

Thanks in advance...


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>