On 11/21/24 16:24, Bitfox wrote:
Hi

I have a interactive command like the following,

$ ./filen
/ > upload upt-snappy /
Uploading upt-snappy [========================================] 100% | ETA: 0s | 1.4 KiB / 1.32 KiB
/ >


the command "filen" will open a interactive shell, and in this shell to upload/download files.

How can I write a script for this case to upload file automatically?

Thanks.


The canonical old-school solution for automating command line programs is expect(1):

https://man7.org/linux/man-pages/man1/expect.1.html


Some scripting languages have the ability to achieve the same effect. I prefer Perl, so:

https://metacpan.org/pod/Expect


David

Reply via email to