From owner-freebsd-questions@FreeBSD.ORG Sat Dec 29 10:20:04 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14F83A31 for ; Sat, 29 Dec 2012 10:20:04 +0000 (UTC) (envelope-from sam.gh1986@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id AA0388FC0A for ; Sat, 29 Dec 2012 10:20:03 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fy27so11497841vcb.41 for ; Sat, 29 Dec 2012 02:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=901Vgs5wJcGOxjPIV4l8Bgpr1YkkZUkJMcQ0FAFVIFs=; b=DmQL05mnbO/guBRjb7RrjB/mIXEWCj5dofgO6j+XI9CTp7HRPlPTqQb+qLeIkPEd4P E14j7dDwH32HNUrfHyUSbmxz85fvUlGRhRWauN2v6dka+Qpo8u5uulA4xZf7CzqzAZIG ohQV4KVSmkHxGU5hDVGVOJvCUqHqo0KXUP/tSRR68l7LpQhBA3YITM8qpGoBiYDfkGE/ 457QjqLOPVe67Kg1cepd1JB/OiqECvpdrJmc/9GLqHUAOI2eohYzMmA82TR62kRoEtHx VQ98YFlW6elFhQju2G1ZfTd/yfcecEit03/nDV3m5sb9Hlo4dMV1Z6AhhWFyViLKvhIY CQ+A== MIME-Version: 1.0 Received: by 10.52.156.72 with SMTP id wc8mr48204174vdb.77.1356776397561; Sat, 29 Dec 2012 02:19:57 -0800 (PST) Received: by 10.58.245.104 with HTTP; Sat, 29 Dec 2012 02:19:57 -0800 (PST) Date: Sat, 29 Dec 2012 13:49:57 +0330 Message-ID: Subject: expect doesn't work correctly with cu From: s m To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2012 10:20:04 -0000 hello every body i want to run cu via expect shell script. when i run my script, cu is running and enter its cli. but when i enter a command (like ~s to set variable) manually , this command doesn't execute and cu cli is closed and bash return an error that this command is not valid. this is my shell script: #!/usr/local/bin/expect set timeout 20 spawn cu -l /dev/ttyu0 -s 115200 -e expect "Connected" send "~s" expect "~[]" send "hardwareflow\n" expect eof and this is the output: [root@zharf ~]# /usr/SAM/shell-scripts/runcu.sh spawn cu -l /dev/ttyu0 -s 115200 -e Connected ~[set] *all / *i enter this command manually [root@zharf ~]# all bash: all: command not found [root@zharf ~]# i don't know what happened when i run cu via expect that doesn't work correctly. please let me know if you have any ideas. yours, SAM