PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > how to convert a list of files to an FTP command ...
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

how to convert a list of files to an FTP command ...

Réponse
 
LinkBack Outils de la discussion
Vieux 07/12/2006, 22h18   #1
laredotornado@zipmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to convert a list of files to an FTP command ...

Hi,

Given the list of files generated from this statement

find . -type f

How would I insert each into successive iterations of this command

printf "%s\n" "put ${FILE_PATH}" | ftp myhost.com

I'm on Fedora Core 5 Linux using an sh script.

Thanks, - Dave

  Réponse avec citation
Vieux 07/12/2006, 22h39   #2
Stephane CHAZELAS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to convert a list of files to an FTP command ...

2006-12-7, 14:18(-08), laredotornado@zipmail.com:
> Hi,
>
> Given the list of files generated from this statement
>
> find . -type f
>
> How would I insert each into successive iterations of this command
>
> printf "%s\n" "put ${FILE_PATH}" | ftp myhost.com
>
> I'm on Fedora Core 5 Linux using an sh script.

[...]

With zsh

autoload -U zfinit # if not already in your ~/.zshrc
zfinit #

zfopen myhost.com
zfput ./**/*(D.)

Or:

zfput -r .

to replicate the directory structure on the server.

See:

info -f zsh -n 'Zftp Function System'
for details

In any case, I wouldn't use the ftp command. Use lftp or any
other scriptable ftp client.

--
Stéphane
  Réponse avec citation
Vieux 08/12/2006, 11h41   #3
Tony Lawrence
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to convert a list of files to an FTP command ...


laredotornado@zipmail.com wrote:
> Hi,
>
> Given the list of files generated from this statement
>
> find . -type f
>
> How would I insert each into successive iterations of this command
>
> printf "%s\n" "put ${FILE_PATH}" | ftp myhost.com
>
> I'm on Fedora Core 5 Linux using an sh script.



Probably not how you want to do it.

Plain old ftp is not easily scripted - it can't handle failure well.
However, for very simple cases, you can use "here" files or .netrc
files.

See http://aplawrence.com/Unixart/scripting_ftp.html for examples and
better choices for more robust use.

--
Tony Lawrence
Unix/Linux/Mac OS X Resources
http://aplawrence.com

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09362 seconds with 11 queries