How to put result from pipe to Samba drive with smbclient?

1.1k Views Asked by At

I would like to do something like this?

echo "test"  | smbclient //server/share -c "cd /target/location/;put <RESULT_FROM_PIPE> <AS_THIS_FILENAME>"

Any idea?

1

There are 1 best solutions below

0
On

Well finally, this is the solution I found:

echo "test"  | smbclient //server/share -c "cd /target/location/;put - <NEW_THIS_FILENAME>"

The trick is in the dash - which redirects the stdin.