[ros-users] [Ros-developers] suggest new ros shebang command
kruset at in.tum.de
Wed Aug 10 21:07:31 UTC 2011
As it is not urgent for me, I am dispassionate about the distribution
I briefly thought about just adding the functionality to rosrun or rosh,
just to keep an open mind.
For roslaunch the package argument is optional, it could be optional for
And rosrun could check whether it runs a script, whether there is a
second shebang line (made unique by additional symbols), and if so run
the file with the given script interpreter and args.
As for the name else, some other ideas:
While there is no strong connection to rosh, i would not mind regarding
it as a tool belonging to the rosh group.
On 08/10/2011 06:21 PM, Ken Conley wrote:
> If shorter names are being debated, I offer 'rosbang'. The placement
> of the hyphen in ros-shebang doesn't quite feel like a ros command
> I should also note that part of this discussion also includes what
> distributions ros-shebang should be included in, i.e. should it be
> backported to diamondback, sneak in through the electric freeze,
> The hashbang spec has definitely been an impediment for having a good
> ease-of-use with rosh, so I support at least having this in ROS
> Electric. I'm indifferent to ROS Diamondback as my development is
> always focused on the latest-and-greatest release.
> - Ken
> On Tue, Aug 9, 2011 at 2:40 PM, Thibault Kruse<kruset at in.tum.de> wrote:
>> I would like to make a suggestion.
>> I want to add a command (called ros-shebang for now) to ros/bin that runs
>> script files by invoking a second shebang line.
>> This allows invoking script interpreters with #! and passing additional
>> arguments, as well as invoking interpreters that live in ROS packages.
>> My stake is calling an interpreter for roslisp scripting. However a
>> similar concern is invoking of rosh plugins, see
>> Example for rosh:
>> #! /usr/bin/env ros-shebang
>> #! /usr/bin/env rosrun rosh rosh rosh/echolet.py
>> Example for roslisp:
>> #! /usr/bin/env ros-shebang
>> ;; /usr/bin/env rosrun sbcl run-sbcl.sh --script
>> One less known alternative is to use other directives to declare the
>> script interpreter than #!, (in case you wonder, for lisp, #| and ":";
>> work) however this does not work with python subprocess.Popen, which means
>> roslaunch and rostest would fail to run scripts like that (except using
>> shell=True, but this is strongly discouraged for security and portability
>> - A modification to roslaunch syntax to allow forcing shell=true
>> - an executable in ros/bin that executes roslisp scripts, such that we
>> could write:
>> #! /usr/bin/env ros-run-roslisp-script
>> - A required fixed installation of our lisp implementation, or some custom
>> made variant of /usr/bin/env
>> I wrote a ros-shebang script in python that works, which is no more magic
>> than reading the second line and calling python execvp on it (minus the
>> first two symbols).
>> If a new command were introduced to ros/bin, this would affect more people
>> than those working with roslisp, so opinions should be heard. There is no
>> urgency to this, roslisp works fine as it is without offering comfortable
>> scripting, just as rosh works fine by loading plugins after the shebang
>> Not sure if there are other scripting interpreter usages with similar
>> ros-developers mailing list
>> ros-developers at code.ros.org
>> ros-users mailing list
>> ros-users at code.ros.org
> ros-users mailing list
> ros-users at code.ros.org
More information about the ros-users