I want to put files from the result of the find command from lftp.
I tried:
$> lftp -u foo, sftp://bar lftp foo@bar$> put < !find ./local -type f
But it didn’t work out !!
This worked:
$> lftp -u foo, sftp://bar lftp foo@bar$> !find ./local -type f | awk '{print "put "$1}' > /tmp/files.lftp lftp foo@bar$> source /tmp/files.lftp
Is there any other way !? I would like to use stdio redirection (pipe, stdin ...).
I read the whole man lftp (1) and it seems that the option you have chosen is actually the best .
!
put < !find ...
put
mput
mirror
, - , : script source .
source
, mput:
!find ./local -type f | awk -v ORS=" " 'BEGIN{print "mput "}{print}' > /tmp/files.lftp
: , ! , - .
, :
!find ./local -type f -printf "put %p\n" > /tmp/files.lftp
source -e find ./local -type f \| sed \'s/^\(.*\)$/put \"\1\"/\'
sed find (") a put. , , , , ,... , sed approliy, .
sed
find
"
, (\) (|) , lsftp. sh -like, :
\
|
lsftp
sh
find ./local -type f | sed 's/^\(.*\)$/put "\1"/'
local, plain mput :
local
lcd local && mput * */* */*/* */*/*/*