Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Custom command newline

Thanks for your suggestion.
We will see, if more people ask for this.
pockypuck

Re: Custom command newline

You're the developer, right? Would it be appropriate for me to submit this as a feature request?
martin

Re: Custom command newline

Sorry, new lines are not supported.
pockypuck

Custom command newline

I want to have a remote command that includes a Here String, but I don't see anything in the WinSCP documentation about being able to include a LF (newline) character in the syntax.

I could use printf "\n" remote-side to simulate it, but that somewhat defeats the purpose of why I want to use a Here String in the first place, which is to initialize a variable for a path that may contain all sorts of characters. For instance, let's say WinSCP included the pattern !L to represent LF characters, I would have my command be:
PATH=$(cat <<'///'!L!$!L///!L);!Lmycommand "${PATH:0:-1}"

... which, when expanded, would be:
PATH=$(cat <<'///'
!$
///
);mycommand "${PATH:0:-1}"

/// is used to terminate since there isn't any scenario I know of where a path can include more than two forward slashes (not counting URIs). Then, !$ and ${PATH:0:-1} are used because otherwise the command would include !!L – which would get interpreted as an exclamation point and the letter L instead of the file path and a LF character. Anyway, you get the idea.

I'm posting this here instead of the feature request section because there might already be a way to accomplish this that I don't know about. If there isn't, I can repost it there.