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

Re: modules directories



Dominik Kubla writes:
> Seems reasonable, as long as the cut binary is moved from /usr/bin to /bin

From: Michael Meskes <meskes@Informatik.RWTH-Aachen.DE>
> How about using uname -r | sed -e 's/..$//' instead? I'm no sed guru but it
> appears to work.

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`


	Bruce

--
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: