Skip to content

Commit

Permalink
Quote arguments to echo in libcommon.sh (#591)
Browse files Browse the repository at this point in the history
If /bin/sh is provided by bash, echo will consume arguments such as `-e`. On such a system, running `rosrun gazebo_ros gzserver -e ode empty_world.world` will execute `gzserver` with the `-e` missing (meaning the world file is ignored).
  • Loading branch information
j-rivero committed Jun 16, 2017
1 parent ef08a2c commit 7813a40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gazebo_ros/scripts/libcommon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ relocate_remappings()
command_line=${1}

for w in $command_line; do
if $(echo $w | grep -q ':='); then
if $(echo "$w" | grep -q ':='); then
ros_remaps="$ros_remaps $w"
else
gazebo_args="$gazebo_args $w"
fi
done

echo $gazebo_args$ros_remaps | cut -c 1-
echo "$gazebo_args$ros_remaps" | cut -c 1-
}

0 comments on commit 7813a40

Please sign in to comment.