From: John Kelly on
On Thu, 17 Jun 2010 19:29:49 +0200, Janis Papanagnou
<janis_papanagnou(a)hotmail.com> wrote:

>John Kelly wrote:
>>
>> [...] Linux and bash are so
>> prevalent, they're nearly a de facto standard.
>
>Bash is "standard" on Linux, but not on commercial Unix'es, where ksh is
>prevalent. My Linux boxes have original ksh as well; which is what I use,
>actually.

I can't buy commercial Linux?



--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php

From: Janis Papanagnou on
John Kelly wrote:
> On Thu, 17 Jun 2010 19:29:49 +0200, Janis Papanagnou
> <janis_papanagnou(a)hotmail.com> wrote:
>
>> John Kelly wrote:
>>> [...] Linux and bash are so
>>> prevalent, they're nearly a de facto standard.
>> Bash is "standard" on Linux, but not on commercial Unix'es, where ksh is
>> prevalent. My Linux boxes have original ksh as well; which is what I use,
>> actually.
>
> I can't buy commercial Linux?

I am not sure what you mean to say here. There are of course companies who
sell Linux.

By commercial Unix'es I mean, e.g. IBM's AIX, HP's HP-UX, Sun's Solaris (and
their former SunOS), SGI's IRIX, etc.

There's more out there than Linux.

Janis
From: Jon LaBadie on
John Kelly wrote:
> On Thu, 17 Jun 2010 11:34:18 +0200, Marc Muehlfeld
> <marc.muehlfeld(a)web.de> wrote:
>
>> Am 17.06.2010 11:19, schrieb Chris F.A. Johnson:
>>> eq===========================================================================================
>>> num=20
>>> printf "%.${num}s\n" "$eq"
>>>
>>> Or:
>>>
>>> printf "%s\n" "${eq:0:$num}" ## not portable
>>
>> But this both command require the definition of a looooong line of "=" and I
>> don't know if I need 5, 20, 100, 5000,...
>
> Sounds like you want a string repeat operator or function. I can't
> think of any such feature in bash. Perl may have something like that.

Harry,
If you can use ksh93, its printf has a %c conversion specifier that acts
in a useful way for your needs.

num=20
printf "%.${num}c" "="
====================

bash's printf only prints a single '='.
From: John Kelly on
On Thu, 17 Jun 2010 23:07:00 +0200, Janis Papanagnou
<janis_papanagnou(a)hotmail.com> wrote:

>> I can't buy commercial Linux?
>
>I am not sure what you mean to say here. There are of course companies who
>sell Linux.
>
>By commercial Unix'es I mean, e.g. IBM's AIX, HP's HP-UX, Sun's Solaris (and
>their former SunOS), SGI's IRIX, etc.
>
>There's more out there than Linux.

Now I feel like such a wimp.

Guess I should pay Larry some BIG BUCKS for Solaris, Oracle, and some
really BIG IRON to run it on. Then maybe I won't be a wimp!

:-D



--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php

From: Barry Margolin on
In article <otkk16ti4skg1tov5gvfqa0opjiul9e1h9(a)4ax.com>,
John Kelly <jak(a)isp2dial.com> wrote:

> On Thu, 17 Jun 2010 18:51:25 +0200, Janis Papanagnou
> <janis_papanagnou(a)hotmail.com> wrote:
>
> >But consider that the $(...) variant will run on other modern shells as
> >well
> >while the printf -v doesn't.
>
> I don't know about ksh, but bash spawns a subshell/pid for $(...)
> command substitution. The printf -v does not.
>
>
> >YMMV, but I consider a solution that runs on any modern shell to be
> >preferable
> >to one that uses bash'isms unnecessarily.
>
> I tend to favor efficiency over portability. Linux and bash are so
> prevalent, they're nearly a de facto standard.

If efficiency is your primary concern, why are you using a shell script?

But it sounds like you've never heard the aphorism "Premature
optimization is the root of all evil." Design your code well first, and
optimize it if performance turns out to be a problem.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***