我正在尝试为我的服务器编译deb包.当我去构建时,一切看起来都很好,直到它到达dh_usrlocal
构建停止并返回错误.问题是我第一次尝试这个,我真的不知道在哪里寻找问题.
这是我终端的输出,我还包括我在输出底部运行的命令.
make[2]: Leaving directory `/home/ian/Desktop/scst-2.1.0/src'
make[1]: Leaving directory `/home/ian/Desktop/scst-2.1.0'
dh_install
dh_installdocs
dh_installchangelogs
dh_installexamples
dh_installman
dh_installcatalogs
dh_installcron
dh_installdebconf
dh_installemacsen
dh_installifupdown
dh_installinfo
dh_pysupport
dh_installinit
dh_installmenu
dh_installmime
dh_installmodules
dh_installlogcheck
dh_installlogrotate
dh_installpam
dh_installppp
dh_installudev
dh_installwm
dh_installxfonts
dh_bugfiles
dh_lintian
dh_gconf
dh_icons
dh_perl
dh_usrlocal
dh_usrlocal: debian/scst/usr/local/include/scst/scst.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_user.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/Module.symvers is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_debug.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_const.h is not a directory
dh_usrlocal: debian/scst/usr/local/include/scst/scst_sgv.h is not a directory
rmdir: failed to …
Run Code Online (Sandbox Code Playgroud) 我正在寻找Java的库,这将允许我创建一个交互式shell.我做了一些搜索,并没有发现很多.我发现的大多数是用于向我的应用程序添加命令参数解析的库,这对我没什么帮助.
我找到的最好的导致是一个名为Cliche的库,它完全符合我的需要.问题是它太简单了.我正在寻找更具定制性的东西.
有没有人遇到过更高级的东西?
我试图找到一种方法来存储类的新实例作为Java哈希映射中的值.这个想法是由Java教师给我的,以便创建一个可用于我正在处理的程序的数据存储结构.
他向我推荐的想法是使用存储计算机名称的hashmap作为键,值将是InfoStor.class类的新实例.InfoStor包含getName(),setName(),getMemory()等方法......
我有类和方法几乎设置基本测试,看看它是否可行.我遇到的问题是,一旦我在hashmap中创建了一个新条目,我就无法弄清楚如何使用InfoStor中的方法.
这是我到目前为止的代码;
VMware.class
import java.util.HashMap;
public class VMware {
public static void main(String[] args) {
HashMap <String, Object> mapper = new HashMap();
mapper.put("NS01", new InfoStor("NS01"));
//mapper.get("NS01").
}
}
Run Code Online (Sandbox Code Playgroud)
InfoStor.class
public class InfoStor {
private String vmName;
private String platform;
private Integer memory;
public InfoStor (String name) {
vmName = name;
}
String getName(){
return vmName;
}
void setPlatform(String p){
platform = p;
}
String getPlatform(){
return platform;
}
void setMemory(Integer m){
memory = m;
}
Integer getMemory(){
return …
Run Code Online (Sandbox Code Playgroud) 我想在perl脚本中更改die消息的颜色.我目前正在使用Term :: ANSIColor在我的脚本中进行其他颜色更改.我遇到的消息是,一旦脚本死掉它就无法将颜色重置为终端默认值,终端提示符是我脚本中最后使用的颜色.在这种情况下,它变成红色.
任何想法我怎么能让脚本死掉但仍然改变颜色?
这是有问题的代码块;
#!/usr/bin/perl
use strict;
use warnings;
require Term::ANSIColor;
use Term::ANSIColor;
print "Loading configuration file\n";
# Check if the specified configuration file exists, if not die
if (! -e $config_file_path) {
print color 'red';
die "$config_file_path not found!\n";
print color 'reset';
} else {
print color 'green';
print "$config_file_path loaded\n";
print color 'reset';
}
Run Code Online (Sandbox Code Playgroud)
更新
它工作但现在我无法摆脱模具陈述的部分,说明它发生了什么线.
Loading configuration file
/etc/solignis/config.xml not found!
at discovery.pl line 50.
Run Code Online (Sandbox Code Playgroud)
通常我只是在die函数中添加一个换行符,并消除了die的任何正常错误输出.知道为什么这样做吗?
更新2
根据你的所有建议,我把它拼凑在一起.
print STDERR RED, "$config_file_path not found!"; …
Run Code Online (Sandbox Code Playgroud) 我正在编写一个脚本来生成我想要存储在/ etc/solignis中的配置文件.当我以受限用户身份运行脚本时,它不允许我创建目录或写入文件.因此脚本必须以sudo或root用户身份运行,如何使用sudo检查用户是root还是至少?
我正在尝试构建一个基本的启动脚本,该脚本可以确定我正在运行的操作系统以及是否需要加载任何特殊模块.就Linux而言,我能够通过查看有效的uid检查root $>
是否有办法在Windows上执行类似的操作?
我试图弄清楚如何删除返回值的哈希条目{}
.
我正在做这样的事情;
if (ref($snapshots{"ID\:$id"}) eq "{}") {
print "ID $id hash no snapshots\n";
}
Run Code Online (Sandbox Code Playgroud)
它似乎不起作用.有任何想法吗?
我在一个脚本中走得很远,我正在努力发现它在读取UTF-8字符时遇到了问题.
我在瑞典有一个联系人在他的机器上创建了一个虚拟机,其中有一些UTF-8,当我的脚本击中该虚拟机时,它失去了理智,但它能够读取所有其他处于"正常"状态的虚拟机字符集.
无论如何,也许我的代码会更有意义.
#!/usr/bin/perl
use strict;
use warnings;
#use utf8;
use Net::OpenSSH;
# Create a hash for storing the options needed by Net::OpenSSH
my %ssh_options = (
port => '22',
user => 'root',
password => 'password'
);
# Create a new Net::OpenSSH object
my $ssh = Net::OpenSSH->new('192.168.2.101', %ssh_options);
# Create an array and capture the ESX\ESXi output from the current server
my @getallvms = $ssh->capture('vim-cmd vmsvc/getallvms');
shift @getallvms;
# Process data gathered from server
foreach my …
Run Code Online (Sandbox Code Playgroud) 这应该很简单,
有没有办法使用perl应用.patch文件?
我知道我可以使用system
我正在寻找模块或其他东西.我查看了search.cpan.org,但我想我没有输入正确的搜索来获得我想要的东西.
有帮助吗?