Let's see how many approaches are there to answering the question:
1. Dedicated command (dirname)
2. expr (known also as the S&M method)
3. pipe rev pipe pipe rev (known also as the differential SCSI cable
   method)
4. PTP (Perl/Tcl/Python)
5. Custom COBOL-85 program
6.,7.,8.,... any more bright ideas?


On Mon, 3 Jun 2002, Official Flamer/Cabal NON-Leader wrote:

> Quoth Nadav Har'El:
>
> > I figured that since I came out the total idiot (giving the 4th identical
> > answer in 5 minutes), I'll expand your knowledge by showing *how* this
> > can be done with expr(1) and using shell builtin features.
>
> Nadav, nadav, nadav - this is over-obtuse. Let's try the other way :-)
> ---cuttez---
> marc@hyena:marc/$ which gcc
> /usr/bin/gcc
> marc@hyena:marc/$ which gcc | rev | cut -f 2- -d"/" | rev
> /usr/bin
> ---cuttez---
>
> ch, basicly, says - take the returned string, if any, turn it over, chop
> off its head, turn it over, return it...
>
> But, I must admit, the expr games are quite... errr... esoteric ;-)...
>
> Marc

                                             --- Omer
There is no IGLU Cabal.  Therefore the light bulb at the Citadel Temple
was not replaced.
The deaf in Israel demand 100% captioning of TV news and other programs.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to