Hey list, Is there any way to remove the trailing space that appears to be automatically inserted when \cldcontext output is captured? For instance, Bazaar revision \cldcontext{os.resultof"bzr revno"}. Will show "Bazaar revision 43 ." I've manually checked the output of the command to run and it doesn't appear to add that space character itself, so I am wondering if os.resultof is appending the extraneous space? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Mon, Jun 27 2011, Kip Warner wrote:
Is there any way to remove the trailing space that appears to be automatically inserted when \cldcontext output is captured? For instance,
Bazaar revision \cldcontext{os.resultof"bzr revno"}.
Will show "Bazaar revision 43 ."
I've manually checked the output of the command to run and it doesn't appear to add that space character itself, so I am wondering if os.resultof is appending the extraneous space?
It adds a newline, that's like a space. See this example: \starttext Bazaar revision \cldcontext{os.resultof"echo 123"}. Bazaar revision \cldcontext{os.resultof"echo -n 123"}. Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}. Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}. \stoptext -- Peter
On Mon, 2011-06-27 at 07:23 +0200, Peter Münster wrote:
It adds a newline, that's like a space. See this example:
\starttext Bazaar revision \cldcontext{os.resultof"echo 123"}.
Bazaar revision \cldcontext{os.resultof"echo -n 123"}.
Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}.
Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}. \stoptext
Hey Peter. The tr -d method I found to be the most elegant. Thank you. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On 27-6-2011 9:41, Kip Warner wrote:
On Mon, 2011-06-27 at 07:23 +0200, Peter Münster wrote:
It adds a newline, that's like a space. See this example:
\starttext Bazaar revision \cldcontext{os.resultof"echo 123"}.
Bazaar revision \cldcontext{os.resultof"echo -n 123"}.
Bazaar revision \cldcontext{os.resultof"dummy=`bzr revno`; echo -n $dummy"}.
Bazaar revision \cldcontext{os.resultof"bzr revno | tr -d '\\n'"}. \stoptext
Hey Peter. The tr -d method I found to be the most elegant. Thank you.
or \cldcontext{string.strip(os.resultof("echo -n 123"))} etc ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Kip Warner
-
pmlists@free.fr