Calling sed within a Expect script

This is a discussion on Calling sed within a Expect script within the TCL forums in Programming Languages category; In article <c4c2dbe5-e7ed-484c-8393-84647dc24b6d @ w39g2000prb.googlegroups.com>, JB <jbjunk1 @ gmail.com> wrote:...

Go Back   Application Development Forum > Programming Languages > TCL

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 08-26-2008, 12:13 PM
Cameron Laird
Guest
 
Default Re: Calling sed within a Expect script

In article <c4c2dbe5-e7ed-484c-8393-84647dc24b6d@w39g2000prb.googlegroups.com>,
JB <jbjunk1@gmail.com> wrote:
Reply With Quote
  #12  
Old 08-26-2008, 12:16 PM
Cameron Laird
Guest
 
Default Re: Calling sed within a Expect script

In article <be687b5f-4808-40de-af6d-54a711e6e5a4@p31g2000prf.googlegroups.com>,
JB <jbjunk1@gmail.com> wrote:
Reply With Quote
  #13  
Old 08-26-2008, 01:29 PM
Glenn Jackman
Guest
 
Default Re: Calling sed within a Expect script

At 2008-08-26 12:02PM, "JB" wrote:
> # replace all "funny" chars with a dot
> regsub -all {[^[:graph:][:blank:][\x00-\x08]|[\x0A-\x0C]|[\x0E-
> \x1F]} $line "" line


Yeah, I've never been very comfortable with some of those character
classes ([:graph:],...) That regex can be simplified to:

regsub -all {[\x00-\x08\x0A-\x1F]} $line "" line

Make sure you update the comment, as you're not replacing with a dot
anymore.

> # not required, just house cleaning
> regsub -all {[\[H\[J]} $line "" line


This might be more efficient:
set line [string map {{[H} "" {[J} ""} $line]

--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:32 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.