簡體   English   中英

qsub:如何將參數傳遞給在shell腳本中調用的perl腳本

[英]qsub: how to pass argument to perl script called within a shell script

這是cwd中的內容:

blastn_build.sh q腳本

它們當前都設置為可執行文件(但不是二進制文件)

以下是blastn_build.sh的內容:

#!/bin/bash
update_blastdb.pl --showall

以下是qscript的內容:

qsub -S /bin/bash -V -b n -N nt_wgs_build -pe smp 8 -j y  -o ./nt_wgs_build.sge -l h=n10 -cwd -sync y "./blastn_build.sh"

update_blastdb.pl在我的PATH中,並以#!/ usr / bin / perl開頭


現在的問題是:

運行./blastn_build.sh可以正常工作。 運行./qscript不會...這是錯誤消息:

無法連接到ftp.ncbi.nlm.nih.gov:參數無效

如果我從./blastn_build.sh中刪除--showall參數,那么./blastn_build.sh和./qscript都可以按預期工作。 問題似乎在於如何通過q​​sub將--showall選項正確傳遞給update_blastdb.pl。

任何幫助的理解和修復將不勝感激!

update_blastdb.pl(blast-2.2.31 http://www.ncbi.nlm.nih.gov/books/NBK52640/)wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ncbi -blast-2.2.31 + -x64-linux.tar.gz

#!/usr/bin/perl
# $Id: update_blastdb.pl 446090 2014-09-11 12:12:27Z ivanov $
===========================================================================
#
# Author:  Christiam Camacho
#
# File Description:
#   Script to download the pre-formatted BLAST databases from the NCBI ftp
#   server.
#
#        

use strict;
use warnings;
use Net::FTP;
use Getopt::Long;
use Pod::Usage;
use File::stat;
use Digest::MD5;
use Archive::Tar;
use List::MoreUtils qw(uniq);

use constant NCBI_FTP => "ftp.ncbi.nlm.nih.gov";
use constant BLAST_DB_DIR => "/blast/db";
use constant USER => "anonymous";
use constant PASSWORD => "anonymous";
use constant DEBUG => 0;
use constant MAX_DOWNLOAD_ATTEMPTS => 3;
use constant EXIT_FAILURE => 2;

# Process command line options
my $opt_verbose = 1;
my $opt_quiet = 0;
my $opt_force_download = 0;
my $opt_help = 0;
my $opt_passive = 0;
my $opt_timeout = 120;
my $opt_showall = 0;
my $opt_show_version = 0;
my $opt_decompress = 0;
my $result = GetOptions("verbose+"      =>  \$opt_verbose,
                    "quiet"         =>  \$opt_quiet,
                    "force"         =>  \$opt_force_download,
                    "passive"       =>  \$opt_passive,
                    "timeout=i"     =>  \$opt_timeout,
                    "showall"       =>  \$opt_showall,
                    "version"       =>  \$opt_show_version,
                    "decompress"    =>  \$opt_decompress,
                    "help"          =>  \$opt_help);
$opt_verbose = 0 if $opt_quiet;
die "Failed to parse command line options\n" unless $result;
pod2usage({-exitval => 0, -verbose => 2}) if $opt_help;
pod2usage({-exitval => 0, -verbose => 2}) unless (scalar @ARGV or
                                              $opt_showall or
                                              $opt_show_version);
#rest of code continues...

perl v 5.10.1

看起來您實際上在某個集群環境中工作(或者qsub還有什么?)。 在這個地方,您的qsubed腳本實際上運行在不同的節點上,該節點無法連接到互聯網,可以從不同的目錄開始執行腳本,或者可以從游覽原始主機上進行許多其他錯誤的配置...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM