Surprising it works with bash at all.

For the shell, your string is: '$re=q~', and the rest is no longer escaped.

HTH,
            -- Eric


                                                                                
          
  From:       "Mallya, Vaibhav U" <vaibhav.mal...@nomura.com>                   
          
                                                                                
          
  To:         <beginners@perl.org>                                              
          
                                                                                
          
  Date:       07/22/2009 05:29 PM                                               
          
                                                                                
          
  Subject:    Using perl code in K and C shell                                  
          
                                                                                
          





Hi All,
I need to used some perl code in k and C shell. But it is giving me bad
substitution. Same code works fine in bash. Any help would be
appreciated.

perl -i -e '$re=q~'${1//~/\\~}'~; print "$re"; while (<>) { /$re/ ? $c++
: print;}exit($c ? 0 : 1)' /home/vmallya/testing || echo " Delete of
lines containing."}
ksh: "\$re=q~"${1//~/\\~}"~; print \"\$re\"; while (<>) { /\$re/ ? \$c++
: print;}exit(\$c ? 0 : 1)": bad substitution


Regards,
Vaibhav U Mallya






This e-mail (including any attachments) is confidential, may contain
proprietary or privileged information and is intended for the named
recipient(s) only. Unintended recipients are prohibited from taking action
on the basis of information in this e-mail and must delete all copies.
Nomura will not accept responsibility or liability for the accuracy or
completeness of, or the presence of any virus or disabling code in, this
e-mail. If verification is sought please request a hard copy. Any reference
to the terms of executed transactions should be treated as preliminary only
and subject to formal written confirmation by Nomura. Nomura reserves the
right to monitor e-mail communications through its networks (in accordance
with applicable laws). No confidentiality or privilege is waived or lost by
Nomura by any mistransmission of this e-mail. Any reference to "Nomura" is
a reference to any entity in the Nomura Holdings, Inc. group. Please read
our Electronic Communications Legal Notice which forms part of this e-mail:
http://www.Nomura.com/email_disclaimer.htm

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/






-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to