Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Aug 2001 17:21:42 -0700 (PDT)
From:      Tony <tony@idk.com>
To:        questions@freebsd.org
Subject:   Re: how to run a shell script but not execute
Message-ID:  <200108250021.RAA03258@idk.com>
In-Reply-To: <no.id> from "Mike Meyer" at Aug 24, 2001 06:03:22 PM

next in thread | previous in thread | raw e-mail | index | archive | help
Let me rephrase the question:

I have a large script with many conditionals in it. I want to preprocess this
script so that the end results is a script that would have been executed
(but was not).

> 
> 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?200108250021.RAA03258>