bash problem ???

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Jeremy C. Reed
Dátum:  
Tárgy: bash problem ???
On Fri, 5 Sep 2003, Nathan England wrote:

> nathan/is/brain/dead            I want dead
> my/computer/is/not/helping      I want helping
> this/sucks                              I want sucks

>
> get it?
> How can I accomplish this with bash?


#!/bin/bash
IFS=/
for last in $1 ; do : ; done
echo last is $last

(You mentioned "bash", you could also use other tools, like awk.)

Jeremy C. Reed
http://bsd.reedmedia.net/