Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Running shell scripts as external tools
Running shell scripts as external tools [message #74649] Wed, 02 July 2003 11:28 Go to next message
Eclipse User
Originally posted by: tim.barrass.bris.ac.uk

Hi all,
I've just got started with Eclipse and the CDT plugin after using KDevelop
and Visual Studio- and am really happy with it so far :o)

I'd like to be able to run a shell script as an External tool. I create a
shell script, and make it executable, within my workspace.

I go to Run->External Tools->External Tools I set up a new Program, with

location
${workspace_loc:/Pool/run.sh}

working directory
${container_loc}

and no other configuration. When I try Run, it tells me

Exception occurred executing command line.

(Yep, it does run from the command line!). The script is:

#!/bin/bash
echo hello!

Any help gratefully received :o) Cheers,
Tim
Re: Running shell scripts as external tools [message #74667 is a reply to message #74649] Wed, 02 July 2003 11:38 Go to previous messageGo to next message
Eclipse User
Originally posted by: tim.barrass.bris.ac.uk

.. and I'm using platform 2.1.0 and CDT 1.1.0, ta.

Tim Barrass wrote:

> Hi all,
> I've just got started with Eclipse and the CDT plugin after using KDevelop
> and Visual Studio- and am really happy with it so far :o)

> I'd like to be able to run a shell script as an External tool. I create a
> shell script, and make it executable, within my workspace.

> I go to Run->External Tools->External Tools I set up a new Program, with

> location
> ${workspace_loc:/Pool/run.sh}

> working directory
> ${container_loc}

> and no other configuration. When I try Run, it tells me

> Exception occurred executing command line.

> (Yep, it does run from the command line!). The script is:

> #!/bin/bash
> echo hello!

> Any help gratefully received :o) Cheers,
> Tim
Re: Running shell scripts as external tools [message #74684 is a reply to message #74649] Wed, 02 July 2003 11:57 Go to previous messageGo to next message
Eclipse User
Originally posted by: burner.zclipse.org

On Wed, 02 Jul 2003 15:28:57 +0000, Tim Barrass wrote:

Run->External Tools->External Tools I set up a new Program, with
>
> location
> ${workspace_loc:/Pool/run.sh}

I believe the problem is that you can't call exec() on a shell script. You
have to specify the location to be /bin/sh and the argument to be
${work...

At least, that's what I do when I need to call a shell script...

mike

>
Re: Running shell scripts as external tools [message #74735 is a reply to message #74649] Wed, 02 July 2003 18:07 Go to previous messageGo to next message
Eclipse User
Originally posted by: gcaglar.hotmail.com

You have to make the script executable, i.e., chmod +x a.sh
Gokhan

"Tim Barrass" <tim.barrass@bris.ac.uk> wrote in message
news:bdutnp$nsv$1@rogue.oti.com...
> Hi all,
> I've just got started with Eclipse and the CDT plugin after using KDevelop
> and Visual Studio- and am really happy with it so far :o)
>
> I'd like to be able to run a shell script as an External tool. I create a
> shell script, and make it executable, within my workspace.
>
> I go to Run->External Tools->External Tools I set up a new Program, with
>
> location
> ${workspace_loc:/Pool/run.sh}
>
> working directory
> ${container_loc}
>
> and no other configuration. When I try Run, it tells me
>
> Exception occurred executing command line.
>
> (Yep, it does run from the command line!). The script is:
>
> #!/bin/bash
> echo hello!
>
> Any help gratefully received :o) Cheers,
> Tim
>
>
>
Re: Running shell scripts as external tools [message #74799 is a reply to message #74684] Thu, 03 July 2003 05:01 Go to previous messageGo to next message
Eclipse User
Originally posted by: user.domain.invalid

Cheers Mike, that works fine for me now :o)

Cheers,
Tim

Michael R Head wrote:
> On Wed, 02 Jul 2003 15:28:57 +0000, Tim Barrass wrote:
>
> Run->External Tools->External Tools I set up a new Program, with
>
>>location
>>${workspace_loc:/Pool/run.sh}
>
>
> I believe the problem is that you can't call exec() on a shell script. You
> have to specify the location to be /bin/sh and the argument to be
> ${work...
>
> At least, that's what I do when I need to call a shell script...
>
> mike
>
>
Re: Running shell scripts as external tools [message #74815 is a reply to message #74799] Thu, 03 July 2003 08:28 Go to previous message
Eclipse User
Originally posted by: gcaglar.hotmail.com

The difference is doing:
/bin/sh a.sh
or having the permissions of a.sh set right and just saying
a.sh
you don't have to start your script with #! if you are doing the first
one...
Gokhan

<user@domain.invalid> wrote in message news:3F03F0D4.10504@domain.invalid...
> Cheers Mike, that works fine for me now :o)
>
> Cheers,
> Tim
>
> Michael R Head wrote:
> > On Wed, 02 Jul 2003 15:28:57 +0000, Tim Barrass wrote:
> >
> > Run->External Tools->External Tools I set up a new Program, with
> >
> >>location
> >>${workspace_loc:/Pool/run.sh}
> >
> >
> > I believe the problem is that you can't call exec() on a shell script.
You
> > have to specify the location to be /bin/sh and the argument to be
> > ${work...
> >
> > At least, that's what I do when I need to call a shell script...
> >
> > mike
> >
> >
>
Previous Topic:Setting breakpoint before pressing Debug button in debugger tab
Next Topic:Outline textformating with blank before open brace
Goto Forum:
  


Current Time: Fri Aug 29 14:28:21 EDT 2014

Powered by FUDForum. Page generated in 0.01829 seconds