>
>On Thu, 07 Jun 2007 17:37:31 +0100 Alan Burlison wrote:
>> Glenn Fowler wrote:
>
>> >> [ x$install = xyes ] && ...
That only works if install is one word or none.
Casper
On 6/7/07, Peter Memishian wrote:
>
> > Looks like it was part of UNIX2003/SUSv3 compliance in Solaris 10:
> > http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4763915
> >
> > In which case, -p would still be needed for any scripts that could ever be
> run
> > on pre-S10 releases.
Here are my comments about coding error checking, the -p option,
and coding style in response to all of the e-mails.
There is no reason to use shcomp for checking for errors, since
you can run ksh -n which will give the same warnings. ksh -n
does a lot more checking and warns about obsolete or s
Glenn Fowler wrote:
[ x$install = xyes ] && ...
>>>
>>> or use the ksh93 [[ ... ]]
>>>
>>> [[ $install == yes ]] && ...
>
>> Or even
>
>> [[ ${install:-no} == yes ]]
>
> why complicate $install to ${install:-no} ?
Just because ;-)
Actually, because it will still work correctl
Glenn Fowler wrote:
>> [ x$install = xyes ] && ...
>
>
> or use the ksh93 [[ ... ]]
>
> [[ $install == yes ]] && ...
>
> -- Glenn Fowler -- AT&T Research, Florham Park NJ --
Or even
[[ ${install:-no} == yes ]]
--
Alan Burlison
--
+-- Casper.Dik at sun.com wrote (Thu, 07-Jun-20,07 20:05 +0200):
|
| >On Thu, 07 Jun 2007 17:37:31 +0100 Alan Burlison wrote:
| >> Glenn Fowler wrote:
| >
| >> >> [ x$install = xyes ] && ...
|
| That only works if install is one word or none.
Which is why
[ "x${install:-}" =
Hi Roland,
you wrote:
... CC:'ing Michelle Olson: Michelle... is there any preferred
layout/style or something which I could as "template" for the language
being used ?
Thanks for taking this on, sounds like a very useful new document. I
think the best template is chapter 7 of the Developer's R
Roland Mainz wrote:
> Peter Memishian wrote:
>> > ... but I am only getting the output of the 2nd script here... am I
>> > doing something wrong ?
>>
>> Hmm, I don't think so, but I also recall running afoul of environment
>> issues when -p was left out scripts like nightly. But now I can't
>> r
Alan Coopersmith writes:
> I. Szczesniak wrote:
> > Why recommend a switch which is no longer needed in Solaris >= 10 for
> > /bin/ksh and /bin/ksh93?
>
> Because it does no harm there, and prevents massive harm on older releases,
> which we know millions of people are still using.
Also because t
On Thu, 07 Jun 2007 17:37:31 +0100 Alan Burlison wrote:
> Glenn Fowler wrote:
> >>[ x$install = xyes ] && ...
> >
> >
> > or use the ksh93 [[ ... ]]
> >
> > [[ $install == yes ]] && ...
> Or even
> [[ ${install:-no} == yes ]]
why complicate $install to ${install:-no} ?
> > Indeed. So coming back around to Roland's write-up: I think it should
> > recommend -p.
>
> Why recommend a switch which is no longer needed in Solaris >= 10 for
> /bin/ksh and /bin/ksh93?
As I understood it, the guide was not about writing shell scripts on
Solaris 10+, it was about wr
On Thu, 7 Jun 2007 11:47:17 -0400 seeger at cise.ufl.edu (Charles Seeger) wrote:
> The other classic problem is that the variable may begin with a "-",
> which test will attempt to interpret as a command line switch. That
> can be addressed either by putting the variable expansion on the right
>
NB: Individual addresses removed, opensolaris-code preserved.
NB2: Eventually I may comment further elsewhere, as I'm not sure that
these are the appropriate venues for a coding style thread.
+-- Roland Mainz wrote (Thu, 07-Jun-2007, 09:47 +0200):
| Casper.Dik at Sun.COM wrote:
| > >
| >
Casper.Dik at Sun.COM wrote:
> >On 6/6/07, Michael Shapiro wrote:
> >> I'm more than happy for it to be published, just ask that you keep
> >> the attribution on it so people who have questions and complaints
> >> can whine at me directly. Maybe when we're done with ksh93 we
> >> can have a mode
Peter Memishian wrote:
>
> > ... but I am only getting the output of the 2nd script here... am I
> > doing something wrong ?
>
> Hmm, I don't think so, but I also recall running afoul of environment
> issues when -p was left out scripts like nightly. But now I can't
> reproduce the problem, so
>On 6/6/07, Michael Shapiro wrote:
>> I'm more than happy for it to be published, just ask that you keep
>> the attribution on it so people who have questions and complaints
>> can whine at me directly. Maybe when we're done with ksh93 we
>> can have a mode which enforces it automatically built-
Ryan Scott writes:
> Michael Shapiro wrote:
>
> > I'm more than happy for it to be published, just ask that you keep
> > the attribution on it so people who have questions and complaints
> > can whine at me directly. Maybe when we're done with ksh93 we
> > can have a mode which enforces it automa
I. Szczesniak wrote:
> On 6/7/07, Peter Memishian wrote:
>>
>> > Looks like it was part of UNIX2003/SUSv3 compliance in Solaris 10:
>> > http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4763915
>> >
>> > In which case, -p would still be needed for any scripts that could
>> ever be r
Roland Mainz writes:
> * Be carefull with using TABS in script code, they are not portable
> between editors or platforms
Could you clarify this one, please?
Are you referring to the ASCII TAB (0x09) character? If so, what's
not "portable" about it? Are you hinting at the people who
misconfigur
On 6/6/07, Roland Mainz wrote:
> The same way as the native command works...
>
> > Surely ksh93 doesn't install setuid by default...
>
> Solaris "chown" isn't a setid application:
> -- snip --
> $ ls -l /usr/bin/chown
> -r-xr-xr-x 1 root bin13196 Mar 25 16:58 /usr/bin/chown
> -- snip
Mike Gerdts wrote:
> On 6/6/07, Roland Mainz wrote:
> > * Use builtin commands if the shell provides them. For example ksh93s+
> > (ksh93, version 's+') delivered with Solaris supports the following
> > builtins:
>
> This seems to favor the use of never specifying the full path to all
> of your c
Peter Memishian wrote:
> > > * Using -p" for starting non-interactive shell scipts is AFAIK a NO-OP,
> > > e.g.
> > > -- snip --
> > > #!/bin/ksh -p
> > > -- snip --
> > > should be replaced with
> > > -- snip --
> > > #!/bin/ksh
> > > -- snip --
> >
> > I've recently been burned by this
Danek Duvall wrote:
> On Thu, Jun 07, 2007 at 12:06:34AM +0200, Roland Mainz wrote:
> > Does Sun have any coding (style) guidelines/notes for Bourne/Korn/POSIX
> > shell scripts ?
>
> No, only C (and, by some extension, C++) and Java. Shell, perl, and python
> are missing.
>
> > A quick review o
Mike Gerdts wrote:
> On 6/6/07, Michael Shapiro wrote:
[snip]
> One nit. In the Quoting section it says:
>
> Use whatever quotes are appropriate for your situation, but please
> do not unnecessarily quote everything (also see 7 above).
>
> The numbers for the sections are missing but I
Ryan Scott wrote:
> Michael Shapiro wrote:
> > I'm more than happy for it to be published, just ask that you keep
> > the attribution on it so people who have questions and complaints
> > can whine at me directly. Maybe when we're done with ksh93 we
> > can have a mode which enforces it automatica
Danek Duvall wrote:
> On Thu, Jun 07, 2007 at 12:06:34AM +0200, Roland Mainz wrote:
> > Does Sun have any coding (style) guidelines/notes for Bourne/Korn/POSIX
> > shell scripts ?
>
> No, only C (and, by some extension, C++) and Java. Shell, perl, and python
> are missing.
>
> > A quick review o
Michael Shapiro wrote:
>
> > Roland> Does Sun have any coding (style) guidelines/notes for Bourne/Korn/
> > Roland> POSIX shell scripts ?
> >
> > Danek> No, only C (and, by some extension, C++) and Java. Shell, perl, and
> > Danek> python are missing.
> >
> > James> Actually, there was a draft sh
> ... but I am only getting the output of the 2nd script here... am I
> doing something wrong ?
Hmm, I don't think so, but I also recall running afoul of environment
issues when -p was left out scripts like nightly. But now I can't
reproduce the problem, so maybe something's been fixed -- or m
Hi!
Does Sun have any coding (style) guidelines/notes for Bourne/Korn/POSIX
shell scripts ? A quick review of some standard scripts like "bfu",
"acr", some of the SMF/Dtrace shell scripts and other stuff reveals some
IMO not very "nice" (where "nice" is more or less an understatement)
const
29 matches
Mail list logo