LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-10-2015, 05:29 AM   #1
mighty_jellyfish
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Rep: Reputation: Disabled
running bash scripts via xbindkeys


I've setup xbindkeys to run some bash scripts on different keys.
However, if a script includes an "export" statement no environment variable is created.
I've already tried "source script.sh" and everything gets executed except for the export statements.

How can i solve this issue?
 
Old 12-10-2015, 06:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
would be nice to explain it better, I do not really understand what did you try and how did you check the result.
But actually I think you wanted to start a script by pressing F1 (for example) and you expected that in your terminal the new settings will be available. But unfortunately that shell (in the terminal) is not affected at all. You need to start that script from that terminal (and not inside another one).
 
Old 12-10-2015, 06:30 AM   #3
mighty_jellyfish
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes, i have a bash script which is started by xbindkeys.

I try to set a environment variable via:

Code:
export VARIABLE=VALUE
i checked for that value on the command line via:
Code:
export VARIABLE
but the variable isn't set at all..

I tried to start the script with:
Code:
source /path/to/script.sh
but this also doesn't work.
 
Old 12-10-2015, 07:08 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
to check a variable use: echo $VARIABLE (no export)
 
Old 12-10-2015, 07:11 AM   #5
mighty_jellyfish
LQ Newbie
 
Registered: Dec 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Did that as well. Also tried:

Code:
export | grep VAR
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] A question about running bash scripts in KDE em21701 Slackware 7 12-11-2009 04:53 PM
running Bash commands in Groovy or Beanshell scripts edomingox Programming 6 04-24-2009 07:07 AM
running bash scripts over ssh connection babag Linux - Newbie 1 05-27-2008 11:07 PM
bash scripts and running .sh files xviddivxoggmp3 Programming 9 08-14-2004 05:33 AM
Running bash scripts from C++ application bfkeats Programming 1 06-18-2003 05:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration