On Fri, Aug 8, 2008 at 19:07, Eelco Dolstra <[EMAIL PROTECTED]> wrote:
> Modified: nixos/trunk/boot/boot-stage-1-init.sh
> ===================================================================
> --- nixos/trunk/boot/boot-stage-1-init.sh 2008-08-08 15:49:57 UTC (rev
> 12544)
> +++ nixos/trunk/boot/boot-stage-1-init.sh 2008-08-08 17:07:04 UTC (rev
> 12545)
>
> +# Poor man's `basename'.
> +basename() {
> + local s="$1"
> + set -- $(IFS=/; echo $s)
> + local res
> + while test $# != 0; do res=$1; shift; done
> + echo $res
> +}
> +
Does this poor man miss shell substitution ?
basename(){
local file="$1"
file="${file%%/}" # remove trailing slash for directories
echo "${file##*/}"
}
--
Nicolas Pierron
- If you are doing something twice then you should try to do it once.
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev