Opened 3 years ago

#63359 new defect

Trace mode causes anything piped to sed from within csh to output the sed executable

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.7.99
Keywords: highsierra Cc:
Port:

Description

When trace mode is enabled, piping anything to the sed executable causes the contents of the sed executable to be printed rather than the desired output. This causes, for example, the magic port to fail to build, because part of its build process uses a csh script which sets a variable which is composed by piping output to sed.

Using the attached test Portfile, when using trace mode (sudo port -dnt configure) the beginning of the configure output is:

DEBUG: Executing org.macports.configure (test)
DEBUG: system: /bin/csh -c 'echo hello world | sed'
E1íE¾E

ˆŒ°îÿÿHÿÀAŠL
uèIÅL‰­À÷ÿÿƄ°îÿÿ





H‰Ú„¸
Aˆ
  $IÿÄE1íŠJHÿ„ÉH‰ÓuÁL+¥îÿÿM܋tîÿÿ‰ÈM‰çD)

This is the contents of the sed executable, which I know because later output includes:

$FreeBSD: src/usr.bin/sed/compile.c,v 1.28 2005/08/04 10:05:11 dds Exp $

This string appears within the sed executable:

$ grep 'src/usr.bin/sed/compile.c,v 1.28 2005/08/04' /usr/bin/sed
Binary file /usr/bin/sed matches

When trace mode is not enabled, it works correctly. Configure output without trace mode (sudo port -dn configure) is:

DEBUG: Executing org.macports.configure (test)
DEBUG: system: /bin/csh -c 'echo hello world | sed'
hello world
Error: Failed to configure test.

This is behaving correctly: sed has passed through the "hello world" string which was echoed to it.

Attachments (1)

Portfile (210 bytes) - added by ryandesign (Ryan Carsten Schmidt) 3 years ago.

Download all attachments as: .zip

Change History (1)

Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: Portfile added
Note: See TracTickets for help on using tickets.