Author Topic: Using System Environment Variables  (Read 9033 times)

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Using System Environment Variables
« on: August 24, 2013, 01:45:03 pm »
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!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Using System Environment Variables
« Reply #1 on: August 24, 2013, 02:41:02 pm »
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.

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #2 on: August 24, 2013, 03:37:32 pm »
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...

 

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #3 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...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Using System Environment Variables
« Reply #4 on: August 24, 2013, 07:41:52 pm »
Without -c and quotes

/bin/sh /home/admin/mycall
works well
but
/bin/sh ${HOME}/mycall
no...

If you use /bin/sh, the variable gets expandend by the shel and not by C::B, so use just $HOME .

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #5 on: August 24, 2013, 08:08:52 pm »
/bin/sh $HOME/mycall
no effect...

in Terminal that works fine
with and without {}
« Last Edit: August 24, 2013, 08:11:52 pm by vv73 »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Using System Environment Variables
« Reply #6 on: August 24, 2013, 11:13:08 pm »
I need the -c here and expanding the variable works fine on fc19 64bit with bash 4.2.45 .

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #7 on: August 25, 2013, 03:41:31 am »
I need the -c here and expanding the variable works fine on fc19 64bit with bash 4.2.45 .
Ok. How can I get the name of the output exefile from the script?
I mean mycall.
« Last Edit: August 25, 2013, 06:58:12 am by vv73 »

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #8 on: August 25, 2013, 07:22:13 am »
BTW

What is marco $TITLE,
it used by default in lunch term inputbox?

I coud not find that in CB documentation.

What macros I can use there except of $TITLE?

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #9 on: August 27, 2013, 04:21:21 pm »
Nobody knows about macros, about $TITLE,
 really?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using System Environment Variables
« Reply #10 on: August 27, 2013, 04:38:04 pm »
I guess this is the title specified in you project -> properties -> project settings
(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!]

Offline vv73

  • Single posting newcomer
  • *
  • Posts: 8
Re: Using System Environment Variables
« Reply #11 on: August 27, 2013, 06:54:06 pm »
I guess this is the title specified in you project -> properties -> project settings

I know that.
But it is important for me to know what marcros I can use there except of that.
I dd not find any $TITLE descprition in CB manual...

The question is still actual.

I want to lanch user own script and get the name of output file there.
And it is good to place that script in user home directory and I want use $HOME or
something like that to make the command universe for all users.