JasonAlt / UberFTP

Interactive GridFTP client
Other
17 stars 14 forks source link

Run commands in batches #3

Open jeff-kline opened 11 years ago

jeff-kline commented 11 years ago

I would like to see the '-cmd' flags work with the '-f' flag. For example, if one would like to remove 50 files with uberftp, simply create a text file 'foo' containing the URLs and then issue the command: uberftp -rm -f foo

Thanks, --Jeff

JasonAlt commented 11 years ago

This is a good idea. I may need to massage the option name some to make it work. As is, -f would be passed to rm and I'd like to reserve -f for forcing if I ever add prompting. I think it should be more inline with the batch option '-f ' which is what I think you intended. Perhaps '-f -rm' although that is not very intuitive imo.

jeff-kline commented 11 years ago

Would it be possible to change the behavior of -cmd to read from stdin if no argument is provided? Or possibly you could specify a file format that allows users to include a command in the file.

JasonAlt commented 11 years ago

I think if you are going to read from stdin, you might as well do:

echo "rm file | uberftp "

The file format change may be the way to go. If the file doesn't contain an explicit command (like rm ) then it could assume 'put' so it would maintain backwards compatibility.

fr4nk5ch31n3r commented 11 years ago

Hi all,

a longer time ago I experimented with passing commands via stdin to uberftp. My goal was to gain low-level protocol access to GridFTP command channels - uberftp has this very nice [l]quote command. But to really benefit from this functionality, you also need to be able to evaluate uberftp's output during a running session.

I came up with a small howto. And as I recognized this "issue", I thought you might be interested. I've entered the howto into the gtransfer wiki. But maybe it would fit better in UberFTP's wiki, although I then could remove part of the introduction.

@JasonAlt Interested?

Bye Frank