Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Aug 2001 18:03:22 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Tony <tony@idk.com>
Cc:        questions@freebsd.org
Subject:   Re: how to run a shell script but not execute
Message-ID:  <15238.56634.556417.593462@guru.mired.org>
In-Reply-To: <66986334@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Tony <tony@idk.com> types:
> I have a shell script that I want to see what it is gonning execute.
> I tried the -n as in the man page.
> What I think my problem  I do not know how to supply the shell script as
> input
> 
> sh -n script
> sh -n < script
> 
> both do show anything.

I take it you mean "not show anything". Of course not - you didn't ask
it to.

The debugging output flags are -v and -x. -v echos the input as it is
read, which is what you want in this case. -x echos the commands
before they are executed. With -n, it does nothing, presumably because
no commands are executed.

> There must have been something I missed to echo the commands but I cannot
> find it.

Both -v and -x are listed on the sh man page.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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