Re: [tcljava-user] '|' as a separator of distinct commands
Brought to you by:
mdejong
From: liobod t. <lio...@gm...> - 2012-10-26 13:45:56
|
I'm also using expect. Expect4j to be precise and i am also able to send and/or to receive the '|' through CLI on equipments. I just want to reproduce those equipments behaviour on a linux box (that's i call a mock). The aim is to test my application code against this box (this false device) to ensure non-regression testing. You can understand i cannot neither test against operationnal equipments in the operationnal network nor have all my tests cases reproduced in a specific test plateform . So i want to mock my tests cases on a easily programmable machine. A linux machine. And this linux system cannot natively consider the '|' an argument of a command. For instance in those equipments you can have the following line : > cmd arg1 | arg3 where '|' is the second argument. Not a separator. On a typical linux shell, the only thing i can do is : > cmd1 arg 1 | cmd2 arg1 where '|' is a separator between cmd1 and cmd1. Not an argument. Hope i'm getting clearer. Thx, 2012/10/26 Ross, Bill <Bil...@ca...> > I am not sure what you are trying to accomplish.**** > > I have used tcl with expect to communicate with Cisco devices.**** > > My script runs on a linux box**** > > I have been able to send the “|” character and capture and recognize it.** > ** > > There are a few times where I struggled getting some characters to work.** > ** > > I can send you some code if that is what you are trying to do. **** > > ** ** > > *From:* liobod tcl [mailto:lio...@gm...] > *Sent:* Friday, October 26, 2012 5:56 AM > *To:* tcl...@li... > *Subject:* [tcljava-user] '|' as a separator of distinct commands**** > > ** ** > > Hello world, > > Sorry if my topic is irrelevant considering this list. > In such case, you may gently tell me where this post would be more > appropriate! > > I'm trying to mock some network equipments (Cisco, Juniper, Whatever, ...) > shell on on a linux shell. > My problem is the '|' character : > - on most of those equipments, '|' is considered as an arg of a command > - on a linux shell, '|' is a separator of distinct commands > > I though tcl could help me to jump over this issue. > After i have installed tcl-8.4.13-4.el5.x86_64.rpm, I did some scripting > through tclsh, tclshrc with no success. > > By now, I'm still digging a full java solution trying to recreate a > console from scratch based on jacl. > I've been playing with > http://www.ensta-paristech.fr/~diam/tcl/online/Using_Tcl_in_Java-20010106.html > I did compile (except ConsoleThread.safeEvalCommand) and run it but i > cannot figure out how insert my custom commands. > > If any of you did face my need and/or this particular issue or found an > alternative solution, i'd be glad to get some return on experience. > > In one word, i'm afraid to face a dead-and problem soon. > And before i get completely stuck, i wonder if some of you guys could give > me a track... > > thanks. **** > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > > |