Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355270

Summary: Correctly handle newline characters in command-line arguments
Product: [Tools] PTP Reporter: John Eblen <jdeblen1>
Component: Remote ToolsAssignee: Project Inbox <ptp-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: g.watson
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 355268    
Bug Blocks:    

Description John Eblen CLA 2011-08-19 16:58:50 EDT
bug 354893 seems to handle all characters correctly except for the newline. Solutions for escaping the newline, though, seem to depend on the particular shell used. For example, the following work as indicated (the comment indicates the type of the user's default shell and of /bin/sh, respectively):

1) /bin/sh -c 'echo $'\''\n'\''' #*/bash, not */dash
2) /bin/sh -c 'echo "a           #any combination of dash and bash, not csh/*
b"'
3) /bin/sh -c 'echo "a\          #csh/*, not bash/*
b"'
Comment 1 Greg Watson CLA 2018-06-08 09:56:30 EDT
Appears to be informational.