From a1083a5d274bdbff0ebf3d7ea63a4d0d6268b2cc Mon Sep 17 00:00:00 2001 From: Tom Boettcher Date: Tue, 21 Jun 2016 09:38:11 -0500 Subject: [PATCH] doc: Update stripHash documentation The documentation now matches the behavior of the function. --- doc/stdenv.xml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/stdenv.xml b/doc/stdenv.xml index d5f37aee15ee..b075e0219a54 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1196,10 +1196,24 @@ echo @foo@ stripHash path Strips the directory and hash part of a store - path, and prints (on standard output) only the name part. For - instance, stripHash - /nix/store/68afga4khv0w...-coreutils-6.12 print - coreutils-6.12. + path, storing the name part in the environment variable + strippedName. For example: + + +stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24" +# prints coreutils-8.24 +echo $strippedName + + + If you wish to store the result in another variable, then the + following idiom may be useful: + + +name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24" +someVar=$(stripHash $name; echo $strippedName) + + +