Discussion:
lftp find command and patterns/asterisk
T***@bertelsmann.de
2014-04-15 11:21:30 UTC
Permalink
Hi,
we want to exit lftp processing, when a file pattern is not matching.
This exits with RC=8, if no hugo.xml file is present:
find hugo.xml || exit 8;

Now for patterns:
glob find *.xml || exit 8;
doesn't work, if no *.xml files are there. It doesn't exit the processing.
Also:
find *.xml || exit 8;
doesn't work, as it seems that lftp find does not accept patterns.

Any hint what must be done to conditionally check if multiple files are present on remote site and exit with a specific RC if they aren't?

Thanks,
Tilo
Alexander V. Lukyanov
2014-04-18 06:43:44 UTC
Permalink
Post by T***@bertelsmann.de
Hi,
we want to exit lftp processing, when a file pattern is not matching.
find hugo.xml || exit 8;
find command expects a directory to dive into in the command line.
Currently it cannot find a file by name, you can use grep for that.
--
Alexander.
T***@bertelsmann.de
2014-05-15 16:51:35 UTC
Permalink
Hi Alexander,
thank you. Can you please give an example how to couple find and grep in lftp for file patterns?

Thanks and regards,
Tilo

-----Original Message-----
From: Alexander V. Lukyanov [mailto:***@netis.ru]
Sent: Friday, April 18, 2014 8:44 AM
To: Mütze, Tilo, NMD-C4.2
Cc: ***@uniyar.ac.ru
Subject: Re: [lftp] lftp find command and patterns/asterisk
Post by T***@bertelsmann.de
Hi,
we want to exit lftp processing, when a file pattern is not matching.
find hugo.xml || exit 8;
find command expects a directory to dive into in the command line.
Currently it cannot find a file by name, you can use grep for that.
--
Alexander.
Loading...