Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] displaying executed commands in shell scripts
- Date: Fri, 8 Jun 2007 21:17:13 +0900
- From: "Arwyn Hainsworth" <arwyn@example.com>
- Subject: Re: [tlug] displaying executed commands in shell scripts
- References: <a96ae3bb0706072143x7a10cd22kf1d86aca73b97cbf@mail.gmail.com> <20070608044748.GA4019@phb> <20070608072137.GI58681@samsara.bebear.net> <20070608080757.GA17166@phb>
On 08/06/07, Dave Brown <dagbrown@example.com> wrote:ArwynOn Fri, Jun 08, 2007 at 04:21:37PM +0900, Al Hoang wrote:
> On Fri, Jun 08, 2007 at 01:47:48PM +0900, Dave Brown wrote:
> > On Fri, Jun 08, 2007 at 01:43:17PM +0900, Hector Akamine wrote:
> > > Hi,
> > >
> > > Is there any way to make the shell console display the commands
> > > executed when a shell script is invoked? For example, if I write a
> > > shell script that contains the command "ls" and I run it, only the
> > > output of the command (in this case the current directory's files) is
> > > displayed on the console window, but not the invoked command ("ls"), I
> > > would like the latter displayed too.
> >
> > An easy one!
> >
> > Just run the script with "sh -x script" to turn on the running
> > commentary.
>
> If your sh isn't bash (Yes Ubuntu I'm talking about you) and your
> script is full of bash-isms remember to use 'bash -x'. Or be noble
> and try to write truly portable POSIX-loving bourne shell compliant
> stuff.
Actually, the POSIX sh isn't Bourne shell at all--it's Korn shell.
Bourne shell has even fewer features than the POSIX shell.
Often you'll find your POSIX shell tucked away somewhere like
/usr/posix/bin/sh rather than /bin/sh where you'd expect to find such a
thing.
The great thing about standards, etc...
Eh? I thought bash was POSIX-compliant. It just has a lot of extra stuff as well, but will run POSIX sh scripts without any problems. At least I haven't noticed any. As such one can always expect /bin/sh to run POSIX scripts, just not always bash scripts.
Also Ubuntu uses Dash for it's /bin/sh, not Korn. IIRC ksh, like bash, is POSIX + extras. It just has different extras to bash. The reason Ubuntu uses dash is due to it being POSIX-only and thus having a low overhead and being a lot faster than the rest.
The above was from memory and I haven't bothered double-checking, so feel free to correct me if I got anything wrong.
- Follow-Ups:
- Re: [tlug] displaying executed commands in shell scripts
- From: Stephen J. Turnbull
- References:
- [tlug] displaying executed commands in shell scripts
- From: Hector Akamine
- Re: [tlug] displaying executed commands in shell scripts
- From: Dave Brown
- Re: [tlug] displaying executed commands in shell scripts
- From: Al Hoang
- Re: [tlug] displaying executed commands in shell scripts
- From: Dave Brown
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] anyone using evolution with exchange 2007 owa yet?
- Next by Date: Re: [tlug] displaying executed commands in shell scripts
- Previous by thread: Re: [tlug] displaying executed commands in shell scripts
- Next by thread: Re: [tlug] displaying executed commands in shell scripts
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links