LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-08-2009, 11:30 AM   #1
cejennings_cr
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Rep: Reputation: 0
tcl/expect stdout redirected to file stops (possibly due to a "@" in exp_send)


I have a shell script to run an tcl/expect script where I want to redirect the stdout and stderr to external files:
Code:
./expect_script.tcl >> stdout.log 2>> stderr.log
The tcl/expect script starts to run and starts to redirect stdout to the log correctly until I get to the following line in my tcl/expect script - were the stdout stops being redirected to the log file:
Code:
exp_send -s "no snmp-server community C00r-H3@l view cutdown RO 10\r"
The expect script runs completely without error (except for the logging issue) - so I really don't know what could be the problem as to why it just stops redirecting the output.
 
Old 07-08-2009, 06:01 PM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Well, if you suspect '@' it might be a good idea to remove it and see what happens.

Have you tried
Code:
set exp_internal 1
. At least it shows what goes back and forth over the connection, sometime that is quite unexpected (no pun intended) and undiscovered because your matching rules prevent this to be printed. But there is a lot of output there and it might be worth looking at it.

BTW, I have a bit of the opposite problem, do you know a solution for this? http://www.linuxquestions.org/questi...stdout-737549/

jlinkels
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
EXPECT/TCL: the "source" command and passing arguments qmqmqm Programming 4 04-02-2009 05:36 PM
My "expect" script is not working... Won't "send" commands... edomingox Programming 4 04-02-2009 03:25 PM
help::: fedora 8 x86_32 install fails due to "file conflicts" maxreason Fedora 3 02-07-2008 12:03 AM
apt-get upgrade error (stops at kernel due to "dependency issues") n0dl Debian 2 02-16-2007 06:20 PM
Expect script throws "open(slave pty): bad file number" error KNut Linux - Newbie 0 02-24-2004 12:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration