From 804b2d6881094f40c97d5e3dc2c89c7e04a848fe Mon Sep 17 00:00:00 2001 From: Yuki Furuta Date: Wed, 23 Nov 2016 22:14:43 +0100 Subject: [PATCH] [jsk_tools][99.jsk_tools.sh] fix: issue #1472 --- jsk_tools/env-hooks/99.jsk_tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsk_tools/env-hooks/99.jsk_tools.sh b/jsk_tools/env-hooks/99.jsk_tools.sh index 6c3977278..8272f5c58 100644 --- a/jsk_tools/env-hooks/99.jsk_tools.sh +++ b/jsk_tools/env-hooks/99.jsk_tools.sh @@ -96,7 +96,7 @@ rossetip_addr() { fi target_host=$target_host_ip fi - export ROS_IP=$(ip -o -4 route get $target_host | awk "/$target_host/ "'{print $5}') + export ROS_IP=$(ip -o -4 route get $target_host | sed -e 's/^.*src \([0-9.]\+\).*$/\1/g') export ROS_HOSTNAME=$ROS_IP }