意想不到的EOF,而寻找匹配的'''

意想不到的EOF,而寻找匹配的''',第1张

概述意想不到的EOF,而寻找匹配的'''

#!/usr/bin/perl use warnings; while(1){ system ( "dialog --menu Customize 30 80 60 " . "'Show rules' 'Show all the current rules' " . "'Flush rules' 'Flush all the tables' " . "Allow IP' 'Block all except one IP' " . "'Block IP' 'Block all the packets from an IP' " . "'Block MAC' 'Block using the harDWare address' " . "'Private networking' 'Allow only one network and block other networks' " . "'Allow lo' 'Allow local network interface' " . "'Save' 'Save customized rules' " . "'Exit' 'Close the program' " . "'more options' '........' 2> /tmp/customize.txt"); open file4,"/tmp/customize.txt" or dIE $!; chomp(my $customize = <file4>); #SHOW RulES if($customize =~ /Show rules/){ `iptables -nvL | tee /tmp/nvl.txt`; system ("dialog --textBox /tmp/nvl.txt 22 70"); } #FLUSH RulES elsif($customize =~ /Flush rules/){ `iptables -F`; system ("dialog --infoBox 'All tables have been flushed.' 05 35"); sleep 2; } #ALLOW IP elsif($customize =~ /Allow IP/){ system ("dialog --inputBox 'Enter the IP address of the sysetm which you want to allow:' 15 40 2> /tmp/allowIP.txt"); open file7,"/tmp/allowIP.txt" or dIE $!; chomp(my $aip = <file7>); `iptables -I input -s $aip -j DROP`; system ("dialog --infoBox 'IP address $aip is allowed and rest are blocked' 05 45"); sleep 2; } #BLOCK IP elsif($customize =~ /Block IP/){ system ("dialog --inputBox 'Enter the IP address of the system which you want to block:' 15 40 2> /tmp/blockIP.txt"); open file5,"/tmp/blockIP.txt" or dIE $!; chomp(my $ip = <file5>); `iptables -A input -s $ip -j DROP`; system ("dialog --infoBox 'IP address $ip has been blocked!' 05 35"); sleep 2; } #PRIVATE NETWORK elsif($customize =~ /Private networking/){ system ("dialog --inputBox 'Enter the network address which you want to allow (eg. 192.168.0.0/24)' 15 40 2> /tmp/network.txt"); open file6,"/tmp/network.txt" or dIE $!; chomp(my $network = <file6>); `iptables -I input -s $network -j ACCEPT`; system ("dialog --infoBox 'Network $network is allowed and rest networks are blocked' 05 35"); sleep 2; } #ALLOW LO elsif($customize =~ /Allow lo/){ `iptables -I input -i lo -j ACCEPT`; system ("dialog --infoBox 'Local interface is allowed.' 05 35"); sleep 2; } #SAVE elsif($customize =~ /Save/){ `service iptables save`; system ("dialog --infoBox 'All rules have been saved successfully' 05 45"); sleep 2; } #EXIT elsif($customize =~ /Exit/){ system ("dialog --infoBox 'Closing application.' 05 35"); sleep 2; exit 0; } else{ exit; } }

perl file.plx

错误 :

sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 1: Syntax error: unexpected end of file

我该如何解决这个错误?

mod_rewrite $ _GET

在Bash脚本中的正则Expression式

什么是最有效的不区分大小写的grep用法?

如何使用linux中的查找指定名为“abc”或“def”的删除子目录

从string中提取分辨率

registry项和值名称的有效字符是什么?

为什么BASH_REMATCH不能用于引用正则Expression式?

正则Expression式只用egrep来捕捉整个单词

在C中parsing正则Expression式

如何在文件夹中的XML文件中grep一个单词

缺少'这里: "Allow IP'

你忘了'

. "Allow IP' 'Block all except one IP' "

在Perl代码的第7行Allow IP'之前。

总结

以上是内存溢出为你收集整理的意想不到的EOF,而寻找匹配的'''全部内容,希望文章能够帮你解决意想不到的EOF,而寻找匹配的'''所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1211713.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存