我有一个变量名,由字符串orig_endpoints_和一个文件名(无扩展名)组成。我该如何设置这个变量为src IPS的空格分隔列表bash设置生成的变量
[bash]# PCAP_FILE=test_w_three.pcap
[bash]# orig_endpoints_test_w_three=blah
[bash]# eval echo "\$$(echo orig_endpoints_${PCAP_FILE%.*})"
blah
[bash]#
现在:DST IPS 我可以查看此使用eval回声像这样?我尝试了eval套装,似乎没有任何运气。
[bash]# orig_endpoints_test_w_three=
[bash]# tmpOrig="10.21.20.66:10.21.20.57 10.21.20.66:10.21.22.25 10.21.20.66:10.21.22.51 10.21.20.66:10.65.111.219 10.21.20.66:10.65.111.220 10.21.20.66:10.65.111.30 10.21.20.66:10.65.52.48"
[bash]# eval set orig_endpoints_${PCAP_FILE%.*}=$tmpOrig
[bash]# eval echo \$$(echo orig_endpoints_${PCAP_FILE%.*})
[bash]# echo $orig_endpoints_test_w_three
[bash]#
有人会知道我该如何设置?
那么简单。我是sooo关闭 – amadain