脚本:
read IP SIP < <(exec ifconfig en0 | awk '/inet / { t = $2; sub(/.*[.]/, "", t); print $2, t }')
我正在尝试隔离THIRD八位字节xxx.xxx.000.xxx并将其放入变量中。救命?谢谢!
答案 0 :(得分:0)
简单的AppleScript解决方案
resources :posts
match ':controller/:action/:id', via: [:get, :post]
match ':controller/:action/:id.:format', via: [:get, :post]
root :controller => "posts", :action => 'index'
答案 1 :(得分:0)
以下将第三个八位字节设置为thirdOctet
变量:
set thirdOctet to do shell script "ifconfig en0 | awk -F . '/inet /{print $3}'"