佐々木と申します。
shell scriptで見付けた特定デイレクトリ下(/home/ftpuser)の全ファイルの
full pathでのリストを、Perl scriptに渡して処理しようと思っています。
xargsを用いて起動しようとしているのですが、うまく行きません。
渡される引数が、空白できられた、ファイル名のリストを想定して
Perlを書いたのですが?
Perlを debuggerで実行したところ、全ファイル名が、連結した形で
渡っているように見えます。
xargs のオプションが足りないのでしょうか? マニュアルをみたのですが?
どなたか、後教示願えませんか。宜しくお願い致します。
distributionはMiracle Linuxv2.0(Redhat7.1ベース)です。
---shell script---------------------------------------
#!/bin/bash
find /home/ftpuser \( -type f -o -type l \) -name "*" -print | xargs -e /usr/local/bin/dbstore.pl
------------------------------------------------------
-----------------Perl script(/usr/local/bin/dbstore.pl)------------------------------
#! /usr/bin/perl -w
while ($ARGV = shift(@ARGV)){
print "$ARGV\n"; ←ここで、引数として、@ARGVにファイルリストを想定していますが?
$fullpath = $ARGV;
@filenames = split(/\//,$fullpath);
$filename = @filenames[@filenames-1];
(省略)
}
------------------------------------------------------------------------------
Follow-Ups:
- Prev by Subject: [linux-users:91996] 本多エレクトロン AH-G10 動作報告
- Next by Subject: [linux-users:91998] Re: Re2: ログインが出来なくなった時
- Previous by thread: [linux-users:91996] 本多エレクトロン AH-G10 動作報告
- Next by thread: [linux-users:91999] Re: [linux-users:91997] shell scriptからPerl scriptへの引数の渡しについて?
- Indexes:[Main][Thread]