Just my 1 cent on the perl script

#!/usr/bin/perl
`cd /path-to-dir`:
`rm *`;

will purge your working directory, not /path-to-dir, as each of the `command`
constructs is executed  in a process of its own and thus has no influence on
the next command

you would be better of with
#!/usr/bin/perl
`cd /path-to-dir;rm *`;

Regards
Christoph


________________________________

Von: owner-m...@openbsd.org im Auftrag von Ed Ahlsen-Girard
Gesendet: Mi 31.12.2008 13:27
An: misc@openbsd.org
Betreff: ftp from script



I'm trying to automate getting the sets and source for running -current.

For some reason, this syntax:

ftp -ia ftp://host.domain/pub/OpenBSD/snapshots/architecture/*.tgz

or this:

ftp -ia ftp://host.domain/pub/OpenBSD/snapshots/architecture/bsd.rd

works great from the command line.  But not in scripts, either shell:

#!/bin/sh

cd /where/I/put/sets

rm *

# all above work fine

ftp -ia ftp://host.domain/pub/OpenBSD/snapshots/architecture/*.tgz

or perl:

#!/usr/bin/perl

`cd /where/I/put/sets`;

`rm *`;

# all above work fine

`ftp -ia ftp://host.domain/pub/OpenBSD/snapshots/architecture/*.tgz`;
<ftp://host.domain/pub/OpenBSD/snapshots/architecture/*.tgz%60;>

Using system () does not get any different behavior, whether I pass a
list or a proper array.  In all cases I see a connection to the server,
followed
by a complaint of an invalid directory, and disconnection.

I've been using perl for about ten years, and I'm pretty sure my perl is ok.
Anybody have an idea of what I'm missing?

Reply via email to