Babu
Babu

Reputation: 5260

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

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?

Upvotes: 2

Views: 1273

Answers (1)

Babu
Babu

Reputation: 5260

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.

Upvotes: 4

Related Questions