From owner-freebsd-questions@FreeBSD.ORG Wed Feb 23 07:50:27 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E88D16A50A for ; Wed, 23 Feb 2005 07:50:26 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D48343D39 for ; Wed, 23 Feb 2005 07:50:03 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from gothmog.gr (patr530-b167.otenet.gr [212.205.244.175]) j1N7npfk007585; Wed, 23 Feb 2005 09:49:53 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.3/8.13.3) with ESMTP id j1N7nfMD000745; Wed, 23 Feb 2005 09:49:41 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.3/8.13.3/Submit) id j1N7nfpQ000744; Wed, 23 Feb 2005 09:49:41 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 23 Feb 2005 09:49:41 +0200 From: Giorgos Keramidas To: Christopher Kelley Message-ID: <20050223074941.GA687@gothmog.gr> References: <421C3181.9020004@kelleycows.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <421C3181.9020004@kelleycows.com> cc: freebsd-questions@freebsd.org Subject: Re: script "echo on" like MS-DOS? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2005 07:50:28 -0000 On 2005-02-22 23:32, Christopher Kelley wrote: > Is there a simple way to cause a shell script to echo to the terminal > similar to the old MS-DOS "echo on" command? You can do similar things with the set -x option of sh(1): % gothmog:/tmp$ cat echo.sh % #!/bin/sh % % set -x % ls /tmp % set +x % echo no echo % ls /tmp % gothmog:/tmp$ sh echo.sh % + ls /tmp % echo.sh screens ssh-6OYAaVIB9P % + set +x % no echo % echo.sh screens ssh-6OYAaVIB9P % gothmog:/tmp$ Note how the commands after set -x are echoed.