Re: sorting pathnames by basename

2002-08-21 Thread John Abreau

mike ledoux <[EMAIL PROTECTED]> writes:

> I see this sort of claim fairly frequently from the Perl crowd, usually
> accompanied by 'everything you need to know is in perldoc'.  Yet every
> time I need to figure out what one of these obscure no-letter variables
> does, perldoc falls down:
> 
>   mwl@voyager:~>perldoc '$|'
>   No documentation found for "$|".

perldoc gives you documentations for perl modules. "$|" is not a module.
These variables are documented in the man pages:

jabr@vishnu:~ $ man perl
PERL(1)  Perl Programmers Reference Guide PERL(1)

NAME
   perl - Practical Extraction and Report Language

   For ease of access, the Perl manual has been split up into
   several sections:

   perlPerl overview (this section)
   perlfaq Perl frequently asked questions
   
   perlvar Perl predefined variables

jabr@vishnu:~ $ man perlvar
PERLVAR(1)   Perl Programmers Reference Guide  PERLVAR(1)

NAME
   perlvar - Perl predefined variables

DESCRIPTION
   Predefined Names

   The following names have special meaning to Perl.  Most
   punctuation names have reasonable mnemonics, or analogs in
   the shells.  Nevertheless, if you wish to use long vari-
   able names, you need only say

   use English;

   at the top of your program.  This will alias all the short
   names to the long names in the current package.  Some even


   autoflush HANDLE EXPR
   $OUTPUT_AUTOFLUSH
   $|  If set to nonzero, forces a flush right away and
   after every write or print on the currently
   selected output channel.  Default is 0 (regardless
   of whether the channel is really buffered by the
   system or not; "$|" tells you only whether you've
   asked Perl explicitly to flush after each write).
   STDOUT will typically be line buffered if output
   is to the terminal and block buffered otherwise.
   Setting this variable is useful primarily when you
   are outputting to a pipe or socket, such as when
   you are running a Perl program under rsh and want
   to see the output as it's happening.  This has no
   effect on input buffering.  See the getc entry in
   the perlfunc manpage for that.  (Mnemonic: when
   you want your pipes to be piping hot.)


-- 
John Abreau / Executive Director, Boston Linux & Unix 
ICQ 28611923 / AIM abreauj / JABBER [EMAIL PROTECTED] / YAHOO abreauj
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99

   Some people say, "The enemy of my enemy is my friend."
   I often respond, "When elephants fight, it's the grass
   that gets trampled."






msg00420/pgp0.pgp
Description: PGP signature


Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Bayard R. Coolidge

[EMAIL PROTECTED] asked:

>>> was Unix ever developed on any of those?
(meaning the 12-bit PDP-8/PDP-12 architectures)

AFAIK, no. I believe that the original development was
on some PDP-11's (11/45's?) that Bell Labs had at the time.
Those, of course, are 16-bit machines. But, I don't ever
hearing about any "back-porting" to the PDP-8's. At the
time, it would have been a real PITA, because the I/O
architectures were totally different. Also, by the time
that UNIX was more or less working well enough to distribute
to its users, the PDP-8 was rapidly approaching end-of-life;
DEC had jumped through some really wierd hoops to get it
to address 128kb of memory, and it was clear that that was it.
The PDP-11s, on the other hand, could do that much fairly
easily and was obviously much more extendible. Much of the
development in the mid-70's was to meet some interesting
requirements that customers had voiced, and obviously some
of those customers were running UNIX.

HTH,

Bayard, who tried, but failed to find his old copy of the
RIM loader...
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Erik Price


On Wednesday, August 21, 2002, at 07:52  PM, mike ledoux wrote:

> So, if I'm in a rush (usually), and I need to figure out what someone
> else's unreadable Perl does, where should I be looking?

I'm too lazy to lift my hands off my keyboard or mouse, to the shelf 
right in front of my face where "Programming Perl" rests, and look up 
the variables.  I usually just head over to http://perldoc.com/ and read 
the man pages there.  For some reason it's just more legible when 
presented as a web page than as a man page in a terminal window.  (Must 
be the whitespace.)

I've bookmarked http://perldoc.com/perl5.6.1/pod/perl.html for easy 
access.



Erik




--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread bscott

On Wed, 21 Aug 2002, at 7:52pm, mike ledoux wrote:
> So, if I'm in a rush (usually), and I need to figure out what someone
> else's unreadable Perl does, where should I be looking?

  For variables, try 'man perlvar' (or 'perldoc perlvar', if you prefer).  
Another very useful reference is 'man perlre' (for regular expressions).  
There are a whole bunch more.  'man perl' will give you a nice list of
topics, and 'man perltoc' will give you a grep'able keyword index.

  (Yes, Derek, this is not immediately obvious.  ;-)

  HTH!

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread bscott

On Wed, 21 Aug 2002, at 6:44pm, Jon Hall wrote:
> To throw a bit (pun un-intentional) more into this discussion, don't
> assume that a "byte" was eight bits.  The PDP-8, Linc-8 and PDP-12 for
> instance, were all twelve bit words, broken down into two six-bit
> characters.

  I'm just curious... was Unix ever developed on any of those?  I was pretty
much under the impression that Unix assumes an 8-bit byte, but I don't
really have anything to back that up...

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Jon Hall

To throw a bit (pun un-intentional) more into this discussion, don't assume
that a "byte" was eight bits.  The PDP-8, Linc-8 and PDP-12 for instance, were
all twelve bit words, broken down into two six-bit characters.

Nevertheless, back in those days saving a few bits for every entry in a symbol
table was worth the time and effort.

md
-- 
=
Jon "maddog" Hall
Executive Director   Linux International(SM)
email: [EMAIL PROTECTED] 80 Amherst St. 
Voice: +1.603.672.4557   Amherst, N.H. 03031-3032 U.S.A.
WWW: http://www.li.org

Board Member: Uniforum Association, USENIX Association

(R)Linux is a registered trademark of Linus Torvalds in several countries.
(SM)Linux International is a service mark of Linux International, Inc.

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: Redhat 7.2 install on Alpha

2002-08-21 Thread Rich Payne

On Wed, 21 Aug 2002, Derek Doucette wrote:

> I'm pretty sure that there are a few Alpha people on this list.  I'm 
> trying to install 7.2 on a digital alphaserver 800 5/500.  When trying 
> to boot I get the following:
> 
> IDE Command not successfully terminated
> ST0 = 40
> Missing address mark

This is the kernel reporting this or the firmware? I've never seen that 
error before. Is this booted from SRM or AlphaBIOS/MILO?
 
> I have searched google a bit and found some posts with similar problems 
> but no results.  I'm pretty familiar with linux, but this is my first 
> shot at an alpha box.  Any ideas to get me started?

Well, I've dealt with Alpha for about 5 years but never seen that 
one before :)

--rdp

-- 
Rich Payne
http://talisman.mv.com

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Redhat 7.2 install on Alpha

2002-08-21 Thread Derek Doucette

I'm pretty sure that there are a few Alpha people on this list.  I'm 
trying to install 7.2 on a digital alphaserver 800 5/500.  When trying 
to boot I get the following:

IDE Command not successfully terminated
ST0 = 40
Missing address mark

I have searched google a bit and found some posts with similar problems 
but no results.  I'm pretty familiar with linux, but this is my first 
shot at an alpha box.  Any ideas to get me started?

Derek
-- 
NeoMail - Webmail that doesn't suck... as much.
http://neomail.sourceforge.net
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: MELBA Tonight

2002-08-21 Thread Matthew J. Brodeur

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 21 Aug 2002, Jeffry Smith wrote:

> What's the word on a MELBA meeting tonight?  I can finally make one, but I 
> haven't seen an announcement.

   You must have missed this:


On Mon, 19 Aug 2002 [EMAIL PROTECTED] wrote:

> When: Wednesday, 21 August 2002, 19:30ish
> Where:Martha's Exchange, Nashua (2nd floor)
> 
> Dinner will be at 18:00ish in the usual corner.  Walk in the front 

   So, despite the fact that this is the *THIRD* Wednesday of this month, 
we are indeed meeting tonight.



- -- 
 -Matt

The goal of science is to build a better mousetrap; the goal of nature
is to build a better mouse.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9Y/voc8/WFSz+GKMRAkaiAJ9p5yhYPToVugVBI6eHTAS0fHUdVACgupPT
ivYsaynLeI1qKBScoXhDvlg=
=Opap
-END PGP SIGNATURE-

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: [gnhlug-announce] MELBA Meeting Wednesday night

2002-08-21 Thread Jefferson Kirkland

The usual place would be Martha's Exchange on Main St. in Nashua.  Here is 
a link to the directions:

http://wiki.gnhlug.org/twiki2/bin/view/Www/Marthas_directions

Dinner is at 6pm.  Go in the front door and turn right.  Turn left at the 
wall and go past the micro brewers.  The usual table(s) are in the back.

Regards,

Jeff K.

At 04:24 PM 8/21/2002 -0400, Ganesan M wrote:
> >
> > When: Wednesday, 21 August 2002, 19:30ish
> > Where: Martha's Exchange, Nashua (2nd floor)
> > Why: Because we haven't gotten together there in a while.
> > (and to heckle Ben :)
>^^
>Where the heck is this Heckle Ben? Just kidding.
>I don't know the usual place. I 'd appreciate
>if you are little more specific.
>
> > Topic: We have none, but if people want to attempt a mini-install
> > fest, bring CDs of the distro of your choice, and we'll aim
> > to help you install.
> >
>I 'd like to install mandrake on my laptop.
>Does anyone owns Mandrake 8.1/8.2?
>I 'd appreciate if you bring it to the meeting
>if you have one.
>
>I already have 8.0.
>
>G.
>
>
>
>___
>gnhlug-discuss mailing list
>[EMAIL PROTECTED]
>http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: [gnhlug-announce] MELBA Meeting Wednesday night

2002-08-21 Thread bscott

On Wed, 21 Aug 2002, at 4:24pm, Ganesan M wrote:
>> (and to heckle Ben :)
> ^^  
> Where the heck is this Heckle Ben? Just kidding.

  Alas, I won't be able to make it tonight, so you will have to find someone
else to heckle instead.  ;-)

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: [gnhlug-announce] MELBA Meeting Wednesday night

2002-08-21 Thread Ganesan M

> 
> When: Wednesday, 21 August 2002, 19:30ish
> Where: Martha's Exchange, Nashua (2nd floor)
> Why: Because we haven't gotten together there in a while.
> (and to heckle Ben :)
^^  
Where the heck is this Heckle Ben? Just kidding.
I don't know the usual place. I 'd appreciate
if you are little more specific.

> Topic: We have none, but if people want to attempt a mini-install 
> fest, bring CDs of the distro of your choice, and we'll aim
> to help you install.
> 
I 'd like to install mandrake on my laptop. 
Does anyone owns Mandrake 8.1/8.2?
I 'd appreciate if you bring it to the meeting
if you have one.

I already have 8.0.

G.



___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



MELBA?

2002-08-21 Thread Jeffry Smith

What's the word on a MELBA meeting tonight?  I can finally make one, but I 
haven't seen an announcement.

If there isn't one, is anyone planning on going to Martha's anyway for 
dinner/talk?

jeff (who does, in fact, live)

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread bscott

On Wed, 21 Aug 2002, at 2:52pm, Bill Freeman wrote:
> The description is close.  Radix 50 actually allows you to get three
> characters into a 16 bit word (40*40*40 <= 65536), or 6 into a 32 bit
> word.

  Ya know, I thought a gain of only one character (five characters, vs the
four 8-bit bytes in a 32-bit word) seemed too small, but I didn't actually
do the math.

  Hypothesis: Since "creat" is a system call, and system calls are often
implemented "behind the scenes" by functions with an underscore prefix
(i.e., "_creat"), that might explain where the sixth character went.

  This debate only goes to show why Ken Thompson might well believe that the
biggest mistake he made was spelling "creat" without the trailing "e".  :-)

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Bill Freeman

Mark Komarinski writes:
 > Good thing more colors other than green and amber were invented too.

Newcommer!  We only had black print on those cards and listings.
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Bill Freeman

[EMAIL PROTECTED] writes:
 >   Way back when 16 kilobytes was a lot of memory, a method for encoding five
 > characters into a single 32-bit machine word was developed.  It was called
 > "Radix-50", or "RAD50".  The 50 is octal, or 40 decimal.  The character set
 > was 26 monocase letters, 10 digits, three special characters, and a null (a
 > total of 40).  This encoding was used in the linkers of various DEC PDP
 > operating systems, which is where Unix was born.
 > 
 >   (That could, of course, be incorrect, but I did find references to
 > Radix-50/RAD50 in some old DEC migration documentation.)

It was also known as "squoze code" around the M.I.T. AI lab.
RAD50 may have originated at DEC, but I wouldn't bet either way.

The description is close.  Radix 50 actually allows you to get
three characters into a 16 bit word (40*40*40 <= 65536), or 6 into a
32 bit word.  5 characters will actually fit into 27 bits (10240
being no greater than 134217728).  That means that you can also have
up to 5 bits of "flags", say, for symbol type, in the same (double 16
bit) word of your symbol table as that which stores the name.  When it
wasn't uncommon to have as little as 4k words (8k bytes) on your
PDP-11/20, people really did care about bit twiddling.

People writing in assembly language for such machines didn't
seem to chaff at such symbol length restrictions.  (Perhaps few of
them could type, and short names were easier.)  Linkers developed for
use with assemblers were pressed into service for linking C because
originally the C compiler produced assembly languagy, and the
assembler was invoked on the output.

Bill
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Bob Bell

On Mon, Aug 19, 2002 at 05:31:14PM -0400, Kevin D. Clark <[EMAIL PROTECTED]> 
wrote:
> You have a list of stuff that you want sorted.  The problem is is that
> you want your stuff sorted according to a field contained in the input
> (the last field).  Further complicating matters is the fact that this
> field is located at a non-constant place in the input field.

I was thinking that `sort -t / -k -1` would be really cool here, but
sort can't sense of a negative column index.  I wonder is the FSF would
accept such a patch to GNU sort?

> The solution: take the input, generate a list from each line, each
> element in the list consists of a tuple consisting of the original
> line plus the comparison key.  Sort the tuple-list using the
> comparison key, and then after the sort is done, strip off all of the
> comparison keys, returning the original list ({sans} tuples), sorted.
> 
> This is actually a well-known technique in Perl, called the
> Schwartzian Transform.  Look it up on the web -- there are plenty of
> good descriptions of it.

That is basically what my example did, but continuing to use sed and
sort instead of perl (for no particular reason -- I could come up with
rationales but they may not be applicable).  My suggestion took the
filename, prepended it so sort could get at it, sorted the data by the
first column only, and then removed that column.  Since I don't see my
post for some reason, I'll repeat it here:

sed -e 's;\(\(.*\)/\)*\(.*\);\3/\1\3;' | sort -fdt/k1 | sed -e 's;[^/]*/\(.*\);\1;'

Since this is mildly different, and I've never heard of the Schwartzian
Transform, I'm going to propose calling this Bell's Method. :-)

-- 
Bob Bell <[EMAIL PROTECTED]>
-
 "The greatest wage gains between 1997 and last year (1998) were
  reported by people working with Linux, a free operating system.
  Their knowledge of this increasingly popular system puts them in
  high demand for Internet projects..."
   -- http://detnews.com/1999/technology/9901/08/01080223.htm
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: [Tutor] little something in the way of file parsing

2002-08-21 Thread Erik Price


On Tuesday, August 20, 2002, at 05:37  PM, [EMAIL PROTECTED] wrote:

>   Heh.  This is pretty ironic.  One of the standard Luddite responses to
> Python is that whitespace is syntactically significant.  Personally, I 
> find
> it a bit weird, but I'm not used to it, and it certainly isn't a
> show-stopper.  But in this case, this property of Python has come into
> conflict with something: The message was mangled by line-wrapping, and 
> thus,
> the indentation is no longer sane.  Any chance you can either (1) fixup 
> the
> code to wrap < 75 columns, or (2) post it on the web somewhere?

Good call.  I talked to the original author (Sean Perry), and he said 
the code is public domain.  I copied it from the origninal email to a 
text file, it's located at

http://homepage.mac.com/~erikprice/debian_avail.py

I encourage anyone with the "available" file on their [Debian] system to 
try it out.  I hope that I didn't mess up the whitespace, if I did just 
let me know.

Sean also told me that the script was *not* used in any final Debian 
release, so if you look for it there you won't find it.  But he has been 
working on improving the script when he's had some free time, so who 
knows for the future.






Erik





--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread bscott

On Wed, 21 Aug 2002, at 10:10am, [EMAIL PROTECTED] wrote:
> Okay, I'll buy that, but why create a linker that only supports 5
> character function names?

  Okay, some Google searches eventually tracked down this explanation:

  Way back when 16 kilobytes was a lot of memory, a method for encoding five
characters into a single 32-bit machine word was developed.  It was called
"Radix-50", or "RAD50".  The 50 is octal, or 40 decimal.  The character set
was 26 monocase letters, 10 digits, three special characters, and a null (a
total of 40).  This encoding was used in the linkers of various DEC PDP
operating systems, which is where Unix was born.

  (That could, of course, be incorrect, but I did find references to
Radix-50/RAD50 in some old DEC migration documentation.)

> I guess I don't fully understand the role of linkers, if this should be an
> obvious thing :)

  A compiler/assembler turns source code into object code modules.  Those
modules are not working programs yet; they have symbolic names instead of
addresses for variables and functions in many places.  You then need to link
the modules together, which includes replacing symbolic names with machine
addresses everywhere.  The output of the linking process is an executable
program.

  Run-time dynamic linking makes things more complex.  *hand wave*

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Mark Komarinski

Good thing more colors other than green and amber were invented too.

-Mark

On Wed, Aug 21, 2002 at 11:00:10AM -0400, Andrew W. Gaunt wrote:
> 
> Back in the early days of computers there weren't
> as many characters to go around and folks had to 
> be very conservative with their use. Since then, more
> have been pulled out of the ground so we can use
> them more liberally.
> 
> -- 
> __
>  | 0|___||.  Andrew Gaunt *nix Sys. Admin., etc.
> _| _| : : }  [EMAIL PROTECTED] - http://www-cde.mv.lucent.com/~quantum
>  -(O)-==-o\  [EMAIL PROTECTED] - http://www.gaunt.org
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Kevin D. Clark


Bob Bell <[EMAIL PROTECTED]> writes:

> Fix your box :-)

Point taken, although I try to write portable code, and as such, I
will always be a little bit conservative when I am using sed.

> > 2:  Those options to sort don't work on my Linux box.
> 
> Really?  They work on mine.  What `sort` do you have?  Mine's from
> a textutils-2.0e-8 RPM.  All options I used are part of UNIX 98
> (http://www.opengroup.org/onlinepubs/007908799/xcu/sort.html).

$ rpm -q -f /bin/sort
textutils-2.0.21-1

> > Still, I see where you're going here.  How about this?
> > 
> >   sed -e 's;\(.*\)/\([^/]*\)$;\2/\1/\2;' | sort -t / +0 | sed 's;[^/]*/;;'
> > 
> > This works on the various Unix boxen that I have at my disposal.
> 
> Nope, you've just forced the pathname to contain a '/'.  But here's
> a simplified version that I think will work around your issues for
> non-UNIX 98 compliant machines:
> 
> sed -e 's;\(.*/\)*\(.*\);\2/\1\2;' | sort -f -d -t / +0 | sed -e 's;[^/]*/;;'

My example, derived from yours, seems to work, as well as your new
solution.

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread Andrew W. Gaunt


Back in the early days of computers there weren't
as many characters to go around and folks had to 
be very conservative with their use. Since then, more
have been pulled out of the ground so we can use
them more liberally.

-- 
__
 | 0|___||.  Andrew Gaunt *nix Sys. Admin., etc.
_| _| : : }  [EMAIL PROTECTED] - http://www-cde.mv.lucent.com/~quantum
 -(O)-==-o\  [EMAIL PROTECTED] - http://www.gaunt.org

[EMAIL PROTECTED] wrote:
> 
> In a message dated: Tue, 20 Aug 2002 16:43:36 EDT
> [EMAIL PROTECTED] said:
> 
> >  I believe it was Ken Thompson, and I believe the remark was intended to be
> >humorous.  Step back and ask: Why would he spell "create" as "creat" in the
> >first place?  If you are going to type five characters, you might as well
> >type six.  The reason it was spelled "creat" in the first place was the
> >linked only supported five characters.  That has caused much
> >head-scratching, question-asking, and recompiling-due-to-typos; hence the
> >remark about the spelling.
> 
> Okay, I'll buy that, but why create a linker that only supports 5
> character function names? What was it which caused this scenario?
> I guess I don't fully understand the role of linkers, if this should
> be an obvious thing :)
> --
> 
> Seeya,
> Paul
> --
> It may look like I'm just sitting here doing nothing,
>but I'm really actively waiting for all my problems to go away.
> 
>  If you're not having fun, you're not doing it right!
> 
> ___
> gnhlug-discuss mailing list
> [EMAIL PROTECTED]
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Hewitt Tech

The complexity of a computer language can result in the use of language
subsets. Specifically, if the language has too many features, programmers
will only learn a subset and since different programmers will learn
different subsets, it becomes difficult for language implementors to
guarantee that the language will be consistent across implementations.
Niklaus Wirth, the designer of Pascal, operated under the philosophy that
computer languages should be no more complicated than necessary. Later
iterations of Pascal such as Modula 2 and Oberon (and their variations) were
made succesively simpler in order to allow the programmer to accomplish his
programming goals while at the same time allowing those that needed to read
these programs to be able to clearly understand them (based on simplified
syntax and a smaller number of reserved words). The Oberon language grammer
fits nicely on a double sided 8x10 sheet of paper. The entire language
report only occupies around 20 pages.  See the language report at:
http://www.oberon.ethz.ch/oreport.html and take note of the quote from A.
Einstein ;^)

-Alex

P.S. Specific languages that have been described as too complex - PL/I, Ada,
C++...
- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 21, 2002 1:32 AM
Subject: Re: sorting pathnames by basename


>
> On Tuesday, August 20, 2002, at 08:28  PM, [EMAIL PROTECTED] wrote:
>
> >   All three mean the same thing, but the first is by far the most
> > common in
> > American English.  Perl is a lot like English.
>
> I couldn't agree more.  Here's why:
>
> English is supposedly the hardest language in the world to learn.  Why?
> Because there are so many ways to say the same thing!  Yes, that is the
> reason AFAIK.  I'm not just talking about synonyms, I'm talking about
> the way you can structure the grammar of the language to mean the same
> thing, but in so many ways.
>
> I studied Japanese for years when I was in college, almost
> double-majoring with it but not quite.  And I was struck by how
> systematic that language is.  Sure, a lot of people will naturally
> wonder if it's very hard, since there is a complex writing system based
> on Chinese that consists of tens of thousands of characters (the
> Kanji).  But as far as learning the core, the very grammar of the
> language itself, it is amazingly straightforward!  Although there is
> "more than one way to do it", this generally has more to do with slang
> and formality than with the way that the language is structured.
>
> Perl is definitely English-like in this regard.
>
>
>
>
>
> Erik
>
>
>
>
>
> --
> Erik Price
>
> email: [EMAIL PROTECTED]
> jabber: [EMAIL PROTECTED]
>
> ___
> gnhlug-discuss mailing list
> [EMAIL PROTECTED]
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
>

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: Perl (or Unix vs. MS, actually)

2002-08-21 Thread pll


In a message dated: Tue, 20 Aug 2002 16:52:35 EDT
"Steven W. Orr" said:

>On Tue, 20 Aug 2002 [EMAIL PROTECTED] wrote:
>=>In a message dated: Tue, 20 Aug 2002 15:16:58 CDT
>=>Thomas Charron said:
>=>
>=>For example, in shell, the construct:
>=>
>=> cd /tmp && rm foo
>
>Whotchoo talkin 'bout Willis?
>
>cd == chdir is a builtin command. But point taken.

Okay, bad example :)  How about:

PID=`ps -ef | grep foo | awk '{print $2}'`
kill -9 $PID

That's 4 sub-processes :)

>Actually, debugging bash isn't all that bad. 

I'm not saying it can't be done, but...

>set -x 

isn't the same as a debugger with break points, watches, etc.

>And there is a full blown 
>debugger available for ksh with breakpoints and everything. :-)

Ooh, now *that's* cool!  Thanks!
-- 

Seeya,
Paul
--
It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

 If you're not having fun, you're not doing it right!


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: UNIX Arcana [was Re: Perl (or Unix vs. MS, actually) ]

2002-08-21 Thread pll


In a message dated: Tue, 20 Aug 2002 16:43:36 EDT
[EMAIL PROTECTED] said:

>  I believe it was Ken Thompson, and I believe the remark was intended to be
>humorous.  Step back and ask: Why would he spell "create" as "creat" in the
>first place?  If you are going to type five characters, you might as well
>type six.  The reason it was spelled "creat" in the first place was the
>linked only supported five characters.  That has caused much
>head-scratching, question-asking, and recompiling-due-to-typos; hence the
>remark about the spelling.

Okay, I'll buy that, but why create a linker that only supports 5 
character function names? What was it which caused this scenario?
I guess I don't fully understand the role of linkers, if this should 
be an obvious thing :)
-- 

Seeya,
Paul
--
It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

 If you're not having fun, you're not doing it right!


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread bscott

On 21 Aug 2002, at 8:52am, Kevin D. Clark wrote:
>> ... sort -fdt/k1 ...
> 
> ... Those options to sort don't work on my Linux box ...

  I assume you mean the -k switch?

  On my RHL 7.3 box, which has GNU sort from GNU textutils 2.0.21, the
"info" manual for "sort" states:

> Warning: the `+POS1' usage is obsolescent.  Future versions of
> POSIX will require that support for it be withdrawn.  Use `--key'
> (`-k') instead.

  Just FYI.

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |


___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Bob Bell

On Wed, Aug 21, 2002 at 08:52:14AM -0400, Kevin D. Clark <[EMAIL PROTECTED]> 
wrote:
> Bob Bell <[EMAIL PROTECTED]> writes:
> > sed -e 's;\(\(.*\)/\)*\(.*\);\3/\1\3;' | sort -fdt/k1 | sed -e 's;[^/]*/\(.*\);\1;'
> 
> This doesn't work for me for a number of reasons:
> 
> 1:  sed is known to contain a number of bugs, and you're hitting one
> of them on my SVR4-derived Solaris box.  That first call to sed
> doesn't yield any changes.

Well, I can't be responsible for broken Unixen, now, can I?  Fix
your box :-)

> 2:  Those options to sort don't work on my Linux box.

Really?  They work on mine.  What `sort` do you have?  Mine's from
a textutils-2.0e-8 RPM.  All options I used are part of UNIX 98
(http://www.opengroup.org/onlinepubs/007908799/xcu/sort.html).

> Still, I see where you're going here.  How about this?
> 
>   sed -e 's;\(.*\)/\([^/]*\)$;\2/\1/\2;' | sort -t / +0 | sed 's;[^/]*/;;'
> 
> This works on the various Unix boxen that I have at my disposal.

Nope, you've just forced the pathname to contain a '/'.  But here's
a simplified version that I think will work around your issues for
non-UNIX 98 compliant machines:

sed -e 's;\(.*/\)*\(.*\);\2/\1\2;' | sort -f -d -t / +0 | sed -e 's;[^/]*/;;'

If '-f' and '-d' are problems, you could just drop them.  I used them
because they were in the original suggestion, so I figure MOD wanted to
use them in the comparison.

-- 
Bob Bell <[EMAIL PROTECTED]>
-
 "Beware of the above code; I have only proved it correct, not tried it."
   -- Donald Knuth, famous computer scientist
___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss



Re: sorting pathnames by basename

2002-08-21 Thread Kevin D. Clark


Bob Bell <[EMAIL PROTECTED]> writes:

> '/' is an illegal character in a filename, right?
> 
> sed -e 's;\(\(.*\)/\)*\(.*\);\3/\1\3;' | sort -fdt/k1 | sed -e 's;[^/]*/\(.*\);\1;'

This doesn't work for me for a number of reasons:

1:  sed is known to contain a number of bugs, and you're hitting one
of them on my SVR4-derived Solaris box.  That first call to sed
doesn't yield any changes.

2:  Those options to sort don't work on my Linux box.


Still, I see where you're going here.  How about this?

  sed -e 's;\(.*\)/\([^/]*\)$;\2/\1/\2;' | sort -t / +0 | sed 's;[^/]*/;;'

This works on the various Unix boxen that I have at my disposal.

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc

___
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss