[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: modules directories



Bruce Perens writes:
> This simple Bash function can replace "cut". It's small enough to include
> in your preinst or postinst script.
> 
> Usage: pick delimiter-character-set field-number
> 	Space is always a member of the delimiter character set.
> 
> pick1() {
>         eval 'echo $'"$pick_index"
> }
> pick() {
>         OLD_IFS=IFS
> 		local delimiter="$1"
> 		shift
> 		pick_index="$1"
> 		shift
>         IFS=" "$delimiter
>         pick1 $*
>         IFS=$OLD_IFS
> 		unset pick_index
> }
> 
> version=$(uname -r)
> echo `pick . 1 $version`.`pick . 2 $version`

Sounds good Bruce. Thanks.

Wichert, what do you think?

Michael
-- 
Michael Meskes                   |    _____ ________ __  ____
meskes@informatik.rwth-aachen.de |   / ___// ____/ // / / __ \___  __________
meskes@sanet.de                  |   \__ \/ /_  / // /_/ /_/ / _ \/ ___/ ___/
meskes@debian.org                |  ___/ / __/ /__  __/\__, /  __/ /  (__  )
Use Debian GNU/Linux!            | /____/_/      /_/  /____/\___/_/  /____/

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: