Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2005 08:43:15 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Christopher Kelley <bsd@kelleycows.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: script "echo on" like MS-DOS?
Message-ID:  <20050223074314.GA553@falcon.midgard.homeip.net>
In-Reply-To: <421C3181.9020004@kelleycows.com>
References:  <421C3181.9020004@kelleycows.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 22, 2005 at 11:32:17PM -0800, 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?
> 
> I've tried to read the fine man pages, and even tried looking at for 
> instance the make scripts that seem to echo their commands to the 
> terminal, but I couldn't even being to follow them.

The answer to that depends entirely on which shell is being used, as it
is the shell itself that will have to do the echoing.

One solution that seems to work for all of /bin/sh, bash, and zsh is to
invoke the shell with the -x flag. Then the shell will echo each
command before executing it.

For other shells there may, or may not be an equivalent.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050223074314.GA553>