From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3C79E138247 for ; Sun, 12 Oct 2014 15:42:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB3DBE0B26; Sun, 12 Oct 2014 15:42:26 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 99F17E0AF3 for ; Sun, 12 Oct 2014 15:42:25 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by gateway2.nyi.internal (Postfix) with ESMTP id 2D25B20428 for ; Sun, 12 Oct 2014 11:42:25 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sun, 12 Oct 2014 11:42:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.co.uk; h= x-sasl-enc:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=5BuNo53n3GEU3yJF72t+Yw8O728=; b=HpyuhR3HS1wkqJNONG ayZe64TMUEGn0Ar3M5ijX6mQPlLlDQKUxffAz0zll0ww3vvBHezBfvShZY69ppap X//fZ8nAye8L7bosGogLmAnQAWmbcj9InRGaRDzqgFOk9AK+GUPQJRiJTL1fHITX DpOY5F5PLqf7tSHBKz1hHbjJE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=5BuNo53n3GEU3yJF72t+Yw 8O728=; b=IA9CIToLd7F8SDvbtC96p/hZCyUXq6rLCfB7J7Qfzb8A6hEFwcgc7W eGOoZkpvIWSjK251Lq1DvCU9njRK2IbUvhCUbaNIVjXDbq9qb1WR0kkde/JKdocP 0XvX67eaJkS8JA1jIapGzddRe1DJJJA4Sg9OZVcDzMjzxdcjczikQ= X-Sasl-enc: 7Frfn2j9PJxNMckyU962l8qjbHO8vLl2qlxDlfDO6yga 1413128544 Received: from [192.168.1.130] (unknown [77.101.146.254]) by mail.messagingengine.com (Postfix) with ESMTPA id C8C18C0000E for ; Sun, 12 Oct 2014 11:42:24 -0400 (EDT) Message-ID: <543AA15E.6090805@fastmail.co.uk> Date: Sun, 12 Oct 2014 16:42:22 +0100 From: Kerin Millar User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:24.0) Gecko/20140731 FossaMail/24.7.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Writing to tty01 (serial port) in simple straight forward way...?!? References: <20141012120802.GA4800@solfire> In-Reply-To: <20141012120802.GA4800@solfire> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 3cf64fae-ff03-493f-8c74-244db25624ee X-Archives-Hash: 6a284efd30919c61203a5f2c66ed1738 On 12/10/2014 13:08, meino.cramer@gmx.de wrote: > Hi, > > I want to send commands to ttyO1 (serial port on an embedded system). > The commands are one line each and terminated with CRL/LF (aka "DOS"). > > Since this will be done from a batch script, it should be possible > via commandline tools and non-interactively. The serial port is > already setup up the right way. > > I tried > > echo -n"blablabal\x0a\x0d" Firstly, this command is missing the -e switch. Secondly, the order of the control characters is wrong. I would suggest the use of printf as it has fewer pitfalls. # printf '%s\r\n' "command" --Kerin