User forums > Help
Script execution and environment issue
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 :
--- Code: ---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$
--- End code ---
"build.sh" is not found !
--- Code: ---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$
--- End code ---
Why is it not found ? Where am I wrong ?
The log of Code::Blocks says that :
--- Code: ---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)
--- End code ---
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.
Folco:
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 :
--- Code: ---/mnt/Data/Programmation/TI/Perso/pdt/pdtlib/src/build.sh: line 5: tigcc: command not found
--- End code ---
tigcc is a compiler installed by myself, and I had already added that in my ~/.bashrc:
--- Code: ---# GCC4TI
export TIGCC=/usr/local/share/gcc4ti
export PATH=$PATH:$TIGCC/bin
--- End code ---
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).
Jenna:
Does the same command work from commandline ?
Folco:
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.
oBFusCATed:
Is bash your default shell?
What is the result of "echo $PATH" is you execute it in the first konsole?
Navigation
[0] Message Index
[#] Next page
Go to full version