刚刚从verycd上下了几个linux的电子书,可惜是超星pdg格式的,google了一下,说有一个叫BooX Viewer的小软件,可惜源里没有,只能下载自己装,里面有个README.txt的文件,说只要./installbxv就可以了,一看installbxv这个文件,原来是个perl脚本,要执行的工作就是在用户目录下向.bash_profile文件中添加两行,可惜,这个在我机器上不好使,我把要添加的两行内容放在了.bashrc文件中,这样就work了哈哈,问题解决,可惜该软件是在命令行下运行的,当然你可以自己手动添加到菜单中。还有一个问题是,我下载的pdg文件用该软件看时,显示不了,一堆乱七八糟的图片。哎,用linux也有利有弊阿。
一下是那个installbxv文件
#!/usr/bin/perl
########################################################
# Install Shell for BXViewer
# 2003/3/6 by Momotalo
########################################################
print "Welcome to the install script of \033[1;31mBooX Viewer\033[0m!\n";
$shell=$ENV{'SHELL'};
$isbash=index($shell,"bash");
print "Install for $shell...\n";
$installdir=`pwd`;
if($isbash ne -1)
{
$cmd1="export LD_LIBRARY_PATH=${installdir}";
$cmd2="export PATH=\$PATH:${installdir}";
open (TEST,"+>>$ENV{'HOME'}/.bash_profile")||die "$!\n";
print TEST "${cmd1}\n${cmd2}";
close(TEST);
}
$iscsh=index($shell,"csh");
if($iscsh ne -1)
{
$cmd1="setenv LD_LIBRARY_PATH ${installdir}";
$cmd2="setenv PATH \$\{PATH\}:${installdir}";
open (TEST,"+>>$ENV{'HOME'}/.cshrc.user")||die "$!\n";
print TEST "${cmd1}\n${cmd2}";
close(TEST);
}
print "\033[1;32minstallation complete!\033[0m\n";
print "logout, and login again\ntype \033[1;31m\"bxv\033[0m\" or \033[1;31m\"bxv filename.pdg\033[0m\" to start the program!\n";
一下是那个installbxv文件
#!/usr/bin/perl
########################################################
# Install Shell for BXViewer
# 2003/3/6 by Momotalo
########################################################
print "Welcome to the install script of \033[1;31mBooX Viewer\033[0m!\n";
$shell=$ENV{'SHELL'};
$isbash=index($shell,"bash");
print "Install for $shell...\n";
$installdir=`pwd`;
if($isbash ne -1)
{
$cmd1="export LD_LIBRARY_PATH=${installdir}";
$cmd2="export PATH=\$PATH:${installdir}";
open (TEST,"+>>$ENV{'HOME'}/.bash_profile")||die "$!\n";
print TEST "${cmd1}\n${cmd2}";
close(TEST);
}
$iscsh=index($shell,"csh");
if($iscsh ne -1)
{
$cmd1="setenv LD_LIBRARY_PATH ${installdir}";
$cmd2="setenv PATH \$\{PATH\}:${installdir}";
open (TEST,"+>>$ENV{'HOME'}/.cshrc.user")||die "$!\n";
print TEST "${cmd1}\n${cmd2}";
close(TEST);
}
print "\033[1;32minstallation complete!\033[0m\n";
print "logout, and login again\ntype \033[1;31m\"bxv\033[0m\" or \033[1;31m\"bxv filename.pdg\033[0m\" to start the program!\n";
没有评论:
发表评论