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) + + +