我试图在Perl中执行以下gpg命令:
`gpg --yes -e -r me@mydomain.com "$backupPath\\$backupname"`;
但是,我得到了以下错误:
Global symbol "@mydomain" requires explicit package name (did you forget to declare "my @mydomain"?)
很明显,我需要避开“@”这个符号,但不知道怎么做。如何在Perl中执行此命令?
我遇到了下面的例子。我试图谷歌,但找不到很多,所以我在这里张贴这个问题。
像这样执行perl脚本有什么好处?
在执行perl代码之后,如何使shell脚本像“普通”shell脚本一样工作呢?
下面是代码:
#!/bin/ksh
#! -*- perl -*-
eval 'exec $PERLLOCATION/bin/perl -x $0 ${1+"$@"} ;'
if 0;
print "hello world\n";
# how can I make it behave like a "normal" shel
我在Windows7上的Perl5.16.3 x64 (用VC10编译)上运行它。
当我运行下面这样的代码时:
use strict;
use warnings;
use IPC::Open3;
use Symbol 'gensym';
my $command = q[perl -e "$| = 1; for (1..60) { print '.'; sleep 1 }"];
my ($in, $out, $err);
$out = gensym;
$err = gensym;
my $pid = open3($in, $out, $err
所以
下面是我的script...when的导入行,我取消对JSON::RPC行的注释,得到下面列出的错误。我甚至没有在脚本中使用库,仍然得到下面列出的错误
#!/usr/bin/perl -w
use Data::Dumper;
use Mail::MboxParser;
use Mail::MboxParser::Mail;
use Mail::Box::Manager;
use Email::Delete qw[delete_message];
use POSIX;
use Date::Calc qw(:all);
#use JSON::RPC::Client;
use strict;
我试图从主脚本中调用第二个脚本。当我使用capture在命令中传递参数时,它是工作的。但是,当我试图在capture函数中分别发送命令和参数时,它给了我一个错误,它找不到指定的文件。
第二脚本
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
my $word= $ARGV[0];
my $crpyt = "$word crypted";
print "$crpyt\n";
my $decrypt = "$word decrypted";
print "$decrypt\n&
我正在尝试从php运行我的python脚本。我得到以下错误
python: relocation error: python: symbol SSL_load_error_strings, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference
我在python脚本中使用了import socket,这导致了这个错误。
如有任何帮助,将不胜感激。
php_code -
shell_exec('python C:/xampp/htdocs/webInterface/php_ex/
我正在运行mac OS X Snow Leopard,我意识到这是一个常见的问题。
我已经安装并重新安装了MySQL的32位和64位二进制安装。
这不起作用,所以我继续(违背我的常识)通过macports安装了perl5,使其具有与雪豹附带的版本完全不同的perl。
我将DBI和DBD::mysql模块重新安装到新的perl中,都成功了。
然而仍然是:
me$ perl5 processmail
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /opt/local/lib/pe
我试图从perl脚本中调用"history“,但是它一直说”不能执行“历史:在gatherinformation.pl第7行没有这样的文件或目录。剧本:
#!/usr/bin/perl
use strict;
use warnings;
open(my $fich ,">>/home/osboxes/Desktop/ConteudosServer/Plano de contingencia/history_report.txt");
`history`;
我只尝试在脚本中使用history,但是它一直给我同样的错误。
我一直在使用HISTFILESIZE
在运行./checksetup.pl时,我会在安装停止的地方得到这个错误。
Reading ./localconfig...
Checking for DBD-mysql (v4.00) ok: found v4.018
Checking for MySQL (v4.1.2) ok: found v5.5.11
/usr/bin/perl: symbol lookup error:
lib/i386-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: i
我想重命名文件名称中的'SR‘,将'sr’替换为'sr‘。这个成功了:
ls | perl -e 'while(<>){chomp;if(/(.*)sr(.*)/){rename $_,$1."SR".$2}}'
但是这个失败了:
ls | perl -e "while(<>){chomp;if(/sr/){rename $_,$\`.'SR'.($')}}"
出现以下错误消息:
Not enough arguments for rename at -e line 1, ne
正在尝试将目录中的所有文件重命名为$arg[1] + number of file。
例如,这些文件:
gfdgfdh.jpg
fgdsyugfs.jpg
gfyudsfuds.jpg
当我在命令行执行sh myscript.sh dog时,将变成以下代码:
dog0.jpg
dog1.jpg
dog2.jpg
以下是我到目前为止拥有的代码,正则表达式之所以起作用,是因为如果它从命令行对一个文件尝试rename命令,它就会起作用。
#! /bin/sh
COUNTER=0
PREFIX=$1
for i in *.jpg
do
rename 's/.*[^.
我正在尝试构建,但我几乎没有遇到与OpenSSL相关的链接器错误(我想)。我试图构建它( OpenSSL ),但它太复杂了,所以我从下载了Win64 OpenSSL v1.0.1e。
我用下面的代码制作了Visual Studio解决方案:
del cmakecache.txt
set FTDIR=D:\Iwan\Projekty\PDF_projekt\freetype-2.4.11
set FTLIBDIR=D:\Iwan\Projekty\PDF_projekt\freetype-2.4.11\objs\win32\vc2010
set JPEGDIR=D:\Iwan\Projekty\
我正在使用bash脚本中的fasta文件。在开始之前,我想检查一下我是否有一个fasta格式的文件。假设我有这个文件:
>seq1
ASVNJF
>seq2
PNGRW
我在试着
#!/bin/bash
if ! [[ $text_file =~ ^(>).+\n[A-Z\n] ]]
then
echo "It is not a fasta file"
fi
但它不起作用。对此有什么想法吗?谢谢你!!
我最近安装了。网站上说它是v5.16。
我使用CPAN安装了。已成功安装。然后,我使用一个示例程序来测试Marpa::PP。当我试图运行它时,我得到了以下错误:
Perl v5.10.0 required--this is only v5.8.0, stopped at perl/site/lib/Marpa/PP.pm line 18.
BEGIN failed--compilation aborted at perl/site/lib/Marpa/PP.pm line 18.
Compilation failed in require at F:\workdir\perl\perl32\s
我将Ubuntu 20.04.2与GNU sed version 4.7结合使用。我有一堆音乐文件被命名奇怪,因为他们没有所有的信息,我指定是在文件名。例如,“布鲁诺火星-纳-布鲁诺火星-懒散Song.aiff”基本上,NA被放在一年的位置,因为这是未知的。我想要做的是重命名所有这些文件,以省略"- NA -“和之前的所有内容,因此该文件是"Bruno Mars - the Lazy Song.aiff”。
这是我的问题,也是我迄今为止尝试过的:我将几个受影响的文件复制到另一个文件夹中,并使用命令sed 's/^.*NA -//' *尝试修复命名,但是我开始从终
我试图使用perl替换如下所示的字符串:
perl -pe "s/FlDigVal/$DIGN/" Header.xml > $DDIRP/$FNAME.xml
如果DIGN=+q4T/h/B8Saf0im3LtBevNvMPsd1PRG5Tz+Iq/uwjXA=出现以下语法错误:
Having no space between pattern and following word is deprecated at -e line 1.
Bareword found where operator expected at -e line 1, near "s/FlD