bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #42725, csh with \n in variables

 
 

bug #42725: csh with \n in variables

Submitted by:  Ole Tange <tange>
Submitted on:  Thu 10 Jul 2014 02:21:52 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Ole Tange <tange>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 15 Jul 2014 01:59:36 PM UTC, comment #2:

Fixed in [9c58321]

Ole Tange <tange>
Project AdministratorIn charge of this item.
Thu 10 Jul 2014 02:24:20 PM UTC, comment #1:

Possible solution: If one of the transferred variables contain \n make the command fail if running under csh:

ssh -tt -oLogLevel=quiet csh@lo 'echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo CSH DOES NOT SUPPORT newlines IN VARIABLES && exec false;
eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null && echo echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\; setenv PARALLEL_PID '$PARALLEL_PID' || echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;' tty\ \>/dev/null\ \&\&\ stty\ isig\ -onlcr\ -echo\;echo\ \$SHELL\ \|\ grep\ \"/t\\\{0,1\\\}csh\"\ \>\ /dev/null\ \&\&\ setenv\ VAR\ line1\"\"line2\ \|\|\ export\ VAR=line1\"'
'\"line2\;echo\ \"\$VAR\"\ 1;

The new section is the first line. 'false;' must be followed by a newline to avoid csh interpreting the rest.

Ole Tange <tange>
Project AdministratorIn charge of this item.
Thu 10 Jul 2014 02:21:52 PM UTC, original submission:

bash@localhost uses bash as login shell. This works fine:

export VAR="line1
line2"
parallel -vv --env VAR -S bash@localhost echo '"$VAR"' ::: 1

csh@localhost uses csh as login shell. This fails:

export VAR="line1
line2"
parallel -vv --env VAR -S csh@localhost echo '"$VAR"' ::: 1

You might think that environment variables should never contain newlines, but you would be wrong: Bash functions are accessed as variables and these mostly contain newlines.

Ole Tange <tange>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tange (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Jul 2014 01:59:36 PM UTCtangeStatusNone=>Fixed
      Assigned toNone=>tange
      Open/ClosedOpen=>Closed
      Summarycsh with \\n in variables=>csh with \n in variables
    Thu 10 Jul 2014 02:24:20 PM UTCtangeSummarycsh with \\n in variables=>csh with \n in variables

    Back to the top


    Powered by Savane 3.1-cleanup1