我想要一个脚本来寻找IP地址等。
我使用以下命令生成列表:
ip -4 neighbor show
但我不知道该怎么看。
command | awk ...
或
for i in command ; do ... done
最后,这似乎是正确的:
LIST=$(the regex of Reda Salih)
for i in $LIST
do
if [ "${i}" == $my_ip]
then
echo found
exit 0
fi
done
echo not found
但还有更优雅的解决方案吗?