More than one command in a single line.

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
magnus
Posts: 26
Joined: Tue Jun 09, 2009 7:11 am
Location: Stockholm, Sweden

More than one command in a single line.

Post by magnus »

I am aware of that this is a kind of a strange question...

But we have a customer that is only allowed to send in one single command from their SFTP front end application.

So I'm looking for a way to get both the ls/+mode= AND the put command in one single line...

Is there a way to do this?
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

There really isn't, but there may be options depending on what they mean by "one line".
Do you have any more information on the environment that the client is running in?

Otherwise, an alternative would be to set the options in the user's Co:Z SFTP profile and then you would only need a "put". But currently this would mean that they would need to use the same options for all files.

In the future, we plan to extend the Co:Z SFTP profile so that options may be specified for filename patterns, which might also help in this situation. We don't have a schedule for this feature, however. Please contact me offline at info@dovetail.com for more information.
john.mckown
Posts: 48
Joined: Tue Jun 12, 2007 2:46 pm

Post by john.mckown »

I don't know what you mean by "one line", but if you're feeding the command to sftp, then just embed an LF in the data stream.

For example, using "echo" on a Linux/Intel desktop:

echo "ls /+mode=text" | sftp user@zos

just does the ls, then exits. But doing:

echo -e "ls /+mode=text\nget something.txt"|sftp user@zos

will do the "ls" followed by the "get" and actually transfer the file with mode=text.

I don't know how your front end works, but I don't know why this would not be possible.
magnus
Posts: 26
Joined: Tue Jun 09, 2009 7:11 am
Location: Stockholm, Sweden

Post by magnus »

dovetail wrote:There really isn't, but there may be options depending on what they mean by "one line".
Do you have any more information on the environment that the client is running in?

Otherwise, an alternative would be to set the options in the user's Co:Z SFTP profile and then you would only need a "put". But currently this would mean that they would need to use the same options for all files.

In the future, we plan to extend the Co:Z SFTP profile so that options may be specified for filename patterns, which might also help in this situation. We don't have a schedule for this feature, however. Please contact me offline at info@dovetail.com for more information.
The problem is that since I'm sitting at the "receiving" end and I don't have access to the customers systems I really can't give much more input on this issue. I'll contact you "offline".
magnus
Posts: 26
Joined: Tue Jun 09, 2009 7:11 am
Location: Stockholm, Sweden

Post by magnus »

john.mckown wrote:I don't know what you mean by "one line", but if you're feeding the command to sftp, then just embed an LF in the data stream.

For example, using "echo" on a Linux/Intel desktop:

echo "ls /+mode=text" | sftp user@zos

just does the ls, then exits. But doing:

echo -e "ls /+mode=text\nget something.txt"|sftp user@zos

will do the "ls" followed by the "get" and actually transfer the file with mode=text.

I don't know how your front end works, but I don't know why this would not be possible.
I don't know, maybe this could work. I'll try to send it to my contact at the customer side.
Post Reply