Results 1 to 4 of 4
Hi
I am writing a bash ftp script.
Is there a way to use the ftp put command with a regular expression to send only selected files (only those that ...
- 03-24-2011 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 15
ftp put regular expression
Hi
I am writing a bash ftp script.
Is there a way to use the ftp put command with a regular expression to send only selected files (only those that do not begin by "boutique_"?
Thanks
Code:#!/bin/bash /usr/bin/ftp -inv serveraddress<<ENDFTP user user pass cd /htdocs bin lcd /site put !(boutique_*).php bye ENDFTP
- 03-26-2011 #2Just Joined!
- Join Date
- Nov 2010
- Posts
- 15
up! please
- 03-26-2011 #3
You need to check the mput command. According to the ftp man page, mput does globbing the same as csh. I don't know how csh does its globbing, so that may be a good place to start.
DISTRO=Arch
Registered Linux User #388732
- 03-28-2011 #4Just Joined!
- Join Date
- Nov 2010
- Posts
- 15
Thanks I use mput now.
But I still have a problem with the special query on the file names
ftp says "invalid command"Code:#!/bin/bash #shopt -s extglob jojo=`find . -maxdepth 1 -type f -not \( -name "boutique_*.php" \) -name "*.php"`; /usr/bin/ftp -inv server<<ENDFTP user login pass cd /htdocs bin lcd /localdir mput "$jojo" bye ENDFTP
Can someone help me get this done?


Reply With Quote