我如何使用这个Perl脚本?

时间:2011-07-04 13:28:37

标签: perl terminal gimp script-fu

我在网上发现了这个perl脚本,但我不知道如何使用它。当我运行它时,它会打开一个空的终端。我不知道该怎么把它放到终端上才能使它工作。

可在此处找到该脚本:http://www.ve3syb.ca/software/gimp/script-update.pl

非常感谢你的帮助。

2 个答案:

答案 0 :(得分:3)

嗯,脚本中的帮助文本说明了这一点:

    print "Usage: $0 [-h|--help|-from xx|-to yy]\n";
    print "       -from xx  Script was written for version xx of GIMP\n";
    print "       -to yy    Output script for use with version yy of GIMP\n";
    print "\n";
    print "GIMP version number should be one:\n";
    print "     10, 12, 20, 22, 24, or 26\n";
    print "\n";
    print "       The script to be updated is read from stdin.\n";
    print "       The updated script is written to stdout.\n";
    print "\n";

这样称呼:

./script.pl -from XX -to YY < input > output

答案 1 :(得分:1)

使用说明在脚本中,它们告诉您如何使用它。请特别注意从stdin读取要更新的脚本的位 - 因此您可能需要将脚本重定向或管道化。

   if ($arg eq "-h" || $arg eq "--help")
    {
        print "Usage: $0 [-h|--help|-from xx|-to yy]\n";
        print "       -from xx  Script was written for version xx of GIMP\n";
        print "       -to yy    Output script for use with version yy of GIMP\n";
        print "\n";
        print "GIMP version number should be one:\n";
        print "     10, 12, 20, 22, 24, or 26\n";
        print "\n";
        print "       The script to be updated is read from stdin.\n";
        print "       The updated script is written to stdout.\n";
        print "\n";
        exit;
    }