LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-25-2018, 06:56 AM   #1
blnl
Member
 
Registered: Nov 2009
Location: The Netherlands
Distribution: Fedora
Posts: 93

Rep: Reputation: 1
Troubleshooting export with heredoc


INTRODUCTION:

I have been using this construct to set the current group after opening a terminal at a compute server:

Code:
newgrp project1_group << ANYCODE
  cd ~/WORK/project1_rundir
  bsub xterm &
ANYCODE
After executing this script, new terminal is opened at a compute server, in the specified project rundir, and the primary group is set correctly. It works just fine...

PROBLEM DESCRIPTION:

Now I would like to set an environment variable at a compute server using the same construct:

Code:
export POLICYFILE=~/WORK/project1_rundir/.policyfile << ANYCODE
  cd ~/WORK/project1_rundir
  bsub xterm &
ANYCODE
It doesn't do anything, not even a terminal is opened.

Does anyone have an explanation, why does 'newgrp' work and 'export' not?

Is there a way to make this work (not necessarily using the heredoc)?

Last edited by blnl; 05-25-2018 at 06:58 AM.
 
Old 05-25-2018, 07:39 AM   #2
blnl
Member
 
Registered: Nov 2009
Location: The Netherlands
Distribution: Fedora
Posts: 93

Original Poster
Rep: Reputation: 1
The problem is solved (even better, without heredoc)...

The final solution is implemented as follows:
Code:
cd ~/WORK/project1_rundir
bsub -I -env "all, POLICYFILE=~/WORK/project1_rundir/.policyfile" tr_xterm &
 
  


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] Setting variables with eval/heredoc does not work as expected Gullible Jones Programming 7 02-13-2014 04:50 PM
telnet to localhost 25 not working in heredoc garagonp Linux - Software 3 03-01-2012 09:52 PM
php 5.3.3 HEREDOC error ohcarol Programming 5 10-29-2010 01:18 AM
capture the stdout of a heredoc in a variable roybal Programming 5 08-13-2010 08:23 PM
Newlines in heredoc Voetsjoeba Linux - Newbie 7 11-04-2006 11:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:13 PM.

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