在我的Makefile中,我試圖提取virtualbox橋接口IP,我設法讓它存儲命令的輸出並回顯它,但是它包含不需要的字符:「Value :「我只想要IP,我曾嘗試在VBoxManageCommand後添加一個awk管道,但似乎無法使其工作。有任何想法嗎?在Makefile中刪除shell執行結果的子字符串
$(eval VB_IP := "$(shell VBoxManage guestproperty get machinename "/VirtualBox/GuestInfo/Net/2/V4/IP")")
@echo $(VB_IP) ### This gives: Value: 10.224.199.19
docker-machine ssh oasis "sed '/--label provider=virtualbox/a --insecure_registry $(VB_IP):5000' /var/lib/boot2docker/profile" ###This makes use of the extracted ip
$(EVAL VB_IP1:= 「$(SHELL VBoxManage guestproperty獲得計算機名 」/ VirtualBox虛擬/ GuestInfo /網/ 2/V4/IP「)」); $(eval VB_IP:= $(shell echo $(VB_IP1)| cut -f2 -d :)) ? –
@DavidKarlsson:我使用'echo'是因爲'VBoxManage'在我的機器上沒有返回相同的輸出。 – choroba