- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试根据 Georgia Wiedmann 的书创建一个 bash 脚本。我的 XP 目标计算机和 Kali 计算机已启动并正在运行。
#!/bin/bash
if [ "$1" == "" ]
then
echo "Usage: ./pingscript.sh [network]"
echo "example: ./pingscript.sh 192.168.x.x"
else
for x in 'seq 1 254'; do
ping -c 1 $1.$x | grep "64 bytes" | cut -d" " -f4 | sed 's/.$//'
done
fi
我不知道 8.8.8.8
应该是我的 XP 的 IP 还是网关地址,但是当我这样做时 ./pingscript.sh 192.168.x.x
我应该是收到响应,但它显示的是 Ping unknown host
。
有人帮忙吗?
最佳答案
这是 shellcheck :
Line 7:
for x in 'seq 1 254'; do
^-- SC2041: This is a literal string. To run as a command, use $(..) instead of '..' .
引用其 wiki :
The intent was to run the code in the single quotes. This would have worked with slanted backticks,
`..`
, but here the very similar looking single quotes'..'
were used, resulting in a string literal instead of command output.This is one of the many problems with backticks, so it's better to use
$(..)
to expand commands.
换句话说,使用:
for x in $(seq 1 254); do
关于linux - ./pingscript.sh - Georgia Weidmann 的书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50496259/
我有网络安全字体 georgia,它非常适合我想要的东西。 我遇到的唯一问题是字体底部没有对齐。 http://jsfiddle.net/JW7F8/ .georgia { font-fam
我有网络安全字体 georgia,它非常适合我想要的东西。 我遇到的唯一问题是字体底部没有对齐。 http://jsfiddle.net/JW7F8/ .georgia { font-fam
在网站上使用 Georgia 进行正文复制,我们注意到文本在 Mac 和 Windows 上的呈现方式存在重大差异。 当使用较小的字体大小时,问题似乎出在 Windows 上,因为浏览器呈现的文本(在
我正在尝试根据 Georgia Wiedmann 的书创建一个 bash 脚本。我的 XP 目标计算机和 Kali 计算机已启动并正在运行。 #!/bin/bash if [ "$1" == "" ]
我不完全确定我的问题是否是由于 Angular 错误或我不知道的 RegEx 的其他原因引起的,但我不明白为什么以下代码在输入后返回“Georgia”记录搜索输入中的“t”。 var app = an
我尝试实现 CSS3 font-feature-settings内衬figures ,特别是对于 Georgia(Windows 7、OpenType),但 Georgia* 似乎只支持旧式图形。 最
我是一名优秀的程序员,十分优秀!