User forums > Using Code::Blocks
Using System Environment Variables
vv73:
Can I use System Variable, such as $HOME
in General Settings, f.e.
for Terminal Program to run Console application?
Like this
${HOME}/myConsoleapp
Or not?
Thanks!
Jenna:
As far as I know, this does not work directly, but you can try to run the command in an own shell.
If yoiu start with /bin/sh -c the system variables get expanded.
vv73:
Unfortunatelly even
/bin/sh -c /home/admin/.codeblocks/wincall
there does not work, because CB does not expand expand it as I need
Executing: /bin/sh -c /home/admin/.codeblocks/wincall /usr/bin/cb_console_runner "/home/admin/test" (in /home/admin)
sh needs one string, but CB does not make it.
If to write
/bin/sh -c "/home/admin/.codeblocks/wincall"
we get
Executing: /bin/sh -c "/home/admin/.codeblocks/wincall" /usr/bin/cb_console_runner "/home/admin/test" (in /home/admin)
Three strings anyway...
vv73:
Without -c and quotes
/bin/sh /home/admin/mycall
works well
but
/bin/sh ${HOME}/mycall
no...
Jenna:
--- Quote from: vv73 on August 24, 2013, 07:39:00 pm ---Without -c and quotes
/bin/sh /home/admin/mycall
works well
but
/bin/sh ${HOME}/mycall
no...
--- End quote ---
If you use /bin/sh, the variable gets expandend by the shel and not by C::B, so use just $HOME .
Navigation
[0] Message Index
[#] Next page
Go to full version