News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Script execution and environment issue

Started by Folco, October 18, 2010, 11:18:12 AM

Previous topic - Next topic

Folco

Hi,


I can't succeed in executing a script using the "Tools" menu.

In the "Settings -> Environment -> General settings" dialog, I have set :
- Shell to run command in : "/bin/bash -c"
- Terminal to launch console programs : "konsole"

In the "Tools" menu, I have added this tool :
- Name : "Build"
- Executable : "konsole"
- Parameters : "--noclose --workdir ${PROJECT_DIR} -e build.sh"
- Working directory : <none>
- Launching options : "Launch tool visible detached (without output redirection)"

But when I launch the tool, I get this message :
Warning: Could not find 'build.sh', starting '/bin/bash' instead.  Please check your profile settings.

folco@Weygand:/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src$

"build.sh" is not found !
folco@Weygand:/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src$ ls build.sh
build.sh
folco@Weygand:/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src$

Why is it not found ? Where am I wrong ?

The log of Code::Blocks says that :
Launching tool 'Build': konsole --noclose --workdir /mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src/ -e build.sh
(in /mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src)

This seems right ?


How to get build.sh to be executed (the file is executable of course, it runs fine from a terminal) ?



I use C::B svn 6714 (the current one today) with Kubuntu 10.10 64 bits, compiled by myself.
Kernel Extremist - PedroM power ©

Folco

#1
Nobody seems to have an idea ? :(

So could some developper say to me where I should look for in the sources to see what I can do to my command to be processed right, please ?


Ok, I advance in the problem: I'have remplaced 'build.sh' with './build.sh. Now my script is called.

but I get an internal error :
/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src/build.sh: line 5: tigcc: command not found
tigcc is a compiler installed by myself, and I had already added that in my ~/.bashrc:
# GCC4TI
export TIGCC=/usr/local/share/gcc4ti
export PATH=$PATH:$TIGCC/bin

The Konsole app seems to be launched without looking at my .bashrc...

I also created a ~/.bash_profile, adding these exports, but I get always the same error.

How to solve that ? (I do want to avoid to call 'tigcc' with its absolute path in my build.sh script).
Kernel Extremist - PedroM power ©

Jenna

Does the same command work from commandline ?

Folco

#3
I have modified the Build tool, now it is set like that :

Executable: konsole
Parameters: --noclose -e ./build.sh
Working dir.: ${PROJECT_DIR}
And "Launch tool visible detached"

C::B log says that :
Launching tool 'Build': konsole --noclose -e ./build.sh (in /mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src)

But I get the error in my script : "/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src/build.sh: line 7: tigcc: command not found"

If I execute by hand , in konsole:
[folco@home]$ konsole --noclose -e ./build.sh
I get the expected result : my script is executed in a new Konsole window, and 'tigcc' is found, so compilation works fine.


So the same command does work from commandline.
Kernel Extremist - PedroM power ©

oBFusCATed

Is bash your default shell?

What is the result of "echo $PATH" is you execute it in the first konsole?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Folco

#5
Yes, bash is my default term.

"echo $PATH" in my build.sh script sends /usr/bin:/home/folco/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/usr/games.
Indeed, /usr/local/share/gcc4ti/bin is not here... :(
Always in this script, "echo $TERM" and "echo $SHELL" says the same thing that in a console started from the K menu:
folco@Weygand:~$ echo $TERM
xterm
folco@Home:~$ echo $SHELL
/bin/bash
folco@Home:~$ echo $PATH
/home/folco/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/share/gcc4ti/bin


I didn't find anything in ~/* and /etc/ to configure konsole, to say it to use ~/.bashrc at boot.
In the "Settings -> Environment -> General settings" dialog, I have set :
- Shell to run command in : "/bin/bash -c"
- Terminal to launch console programs : "konsole"

If you think this is not a CB issue, I will ask on another forum...
Thanks for your help.
Kernel Extremist - PedroM power ©

oBFusCATed

Yes, this is not a C::B issue...

You'll have better luck in your distro's forum/ML.
Another option is to try another terminal, but I think this is a distro/configuration problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Folco

Ok, thank you for all the help already given. :)
Kernel Extremist - PedroM power ©

Folco

Eh... my problem is solved... but I didn't change anything !
Perhaps I needed to reboot C::B, or my PC ? I don't know, but I did it, and now it works, without changing anything in the configuration I gave here (2 posts above).

So if you get trouble with shell/console when setting up a tool, just try to restart C::B or your PC.

Thanks again. :)
Kernel Extremist - PedroM power ©

oBFusCATed

Linux is not windows, it doesn't require a restart for most of the things :)
For changes in the env will be detected, you log out then log in :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]