Search code examples
scp

Use scp to send a file to an IP from a file


I need to send a file ( my_file.txt ) to an FTP Printer whose IP address is contained in another file ( printer_ip.txt ). This file contains only one IP address.

$ cat printer_ip.txt
10.111.22.333

What is the simple command I can use? Something like this?

$ scp  my_file.txt  |  cat printer_ip.txt

Solution

  • I think what you want is

    $ scp my_file.txt $(cat printer_ip.txt)