[Rt-devel] RT 3.6.1 CLI--how to pass in a newline

Jim Brandt cbrandt at buffalo.edu
Fri Sep 1 13:46:44 EDT 2006


Note: original question posted on the RT users list. This is a follow-up
and possible solution.

Thanks to der Mouse for the shell tutorial. :)

I tried his suggestion and while I finally came to terms with my shell,
it confused the rt CLI. I was getting this with newlines:

rt: edit: No variables to set.

I messed around a bit and found that sticking the 'xms' at the end of
the regex seemed to make it work the way I wanted:

         elsif (/^set$/i) {
             my $vars = 0;

--->        while (@ARGV && $ARGV[0] =~ /^($field)([+-]?=)(.*)$/xms) {
                 my ($key, $op, $val) = ($1, $2, $3);

What I don't know is if this causes other un-wanted side effects with 
multi-line commands, thus my post to the dev list. Would this be a 
desired or worthwhile patch?

Thanks,
Jim


der Mouse wrote:
>> So you're thinking I need to trick the shell into sending the proper
>> newline character?
> 
> Yes, though I'm not sure "trick" is the best word. :-)
> 
>> I use tcsh,
> 
> Try 
> 
> % echo 'foo\
> bar'
> 
> that is, a real newline, inside single quotes, but also backslashed.
> That works in all csh derivatives I've run into, including a real tcsh
> (6.13.00) I happen to have access to.  (I don't use tcsh myself.)
> 
> /~\ The ASCII				der Mouse
> \ / Ribbon Campaign
>  X  Against HTML	       mouse at rodents.montreal.qc.ca
> / \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

-- 
Jim Brandt
Administrative Computing Services
University at Buffalo



More information about the Rt-devel mailing list