summary refs log tree commit diff
path: root/doc/stdenv.xml
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-07-15 14:41:01 +0000
committerRobin Gloster <mail@glob.in>2016-07-15 14:41:01 +0000
commit5185bc177309c62e53dad1ad346d1220f0e77bd4 (patch)
tree52f5878b394abf2ef326765d46880ccbabd84903 /doc/stdenv.xml
parent07615735077db344539eb9131823600593f0eddf (diff)
parentf402c6321aa3c6e56f5e1f1e36c4ad459c881309 (diff)
downloadnixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.gz
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.bz2
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.lz
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.xz
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.zst
nixlib-5185bc177309c62e53dad1ad346d1220f0e77bd4.zip
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'doc/stdenv.xml')
-rw-r--r--doc/stdenv.xml22
1 files changed, 18 insertions, 4 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 434b61fd6a4b..303ad2db8a75 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -1196,10 +1196,24 @@ echo @foo@
     <term><function>stripHash</function>
     <replaceable>path</replaceable></term>
     <listitem><para>Strips the directory and hash part of a store
-    path, and prints (on standard output) only the name part.  For
-    instance, <literal>stripHash
-    /nix/store/68afga4khv0w...-coreutils-6.12</literal> print
-    <literal>coreutils-6.12</literal>.</para></listitem>
+    path, storing the name part in the environment variable
+    <literal>strippedName</literal>. For example:
+    
+<programlisting>
+stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
+# prints coreutils-8.24
+echo $strippedName
+</programlisting>
+
+    If you wish to store the result in another variable, then the
+    following idiom may be useful:
+    
+<programlisting>
+name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24"
+someVar=$(stripHash $name; echo $strippedName)
+</programlisting>
+
+    </para></listitem>
   </varlistentry>