[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: commands within shell script



on Wed, 05 Mar 2003 07:49:52AM -0600, Ron Johnson insinuated:
> On Tue, 2003-03-04 at 20:41, Nori Heikkinen wrote:
> > on Tue, 04 Mar 2003 05:13:33PM -0500, Benjamin Rutt insinuated:
> > > Nori Heikkinen <nori@sccs.swarthmore.edu> writes:
> > > > okay, this is cool ... i'd just misunderstood a friend's question.
> > > > he doesn't even want to run top, he wants to stick in a bunch of
> > > > echo statements.
> > > 
> > > In that case, place 'set -x' as the 2nd line of the shell script
> > > (the line after the #! business) and see every command echoed as it
> > > is executed.  -- Benjamin
> > 
> > *exactly* what i(/he) wanted!  thanks!
> 
> Try this:
> #!/bin/bash
> set -x
> set -v
> for i in 1 2 3 4 5;
> do
>     echo foobar${i} ;
> done
> 
> After seeing Benjamin Rutt mention "-x", I tried it along with "-v",
> and having both makes it much easier to see the flow of the script.

well, it's cluttered for me, but both are cool options.  

thanks again,

</nori>

-- 
    .~.      nori @ sccs.swarthmore.edu 
    /V\  http://www.sccs.swarthmore.edu/~nori/jnl/
   // \\          @ maenad.net
  /(   )\       www.maenad.net
   ^`~'^



Reply to: