Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829; Each value is the exact script text bash produces.(def :v "/nix/store/v")(def :xs ["a b" "c"])(def :none [])[(bash (cp -ar "${v}/*" $out/share/)) (bash (echo ,v ,@xs ,@none end) (echo (date) "$(id -u)") (./configure --prefix=$out) (echo 1 -2 ../x)) ; Shell escapes inside strings, and text that needs ''-string escapes. (bash (stat "\${!outputBin}/bin/${v}") (echo "'\${x}'" "a''b" "''\${y}" "a'''b" "$" "x$${v}" "'$${v}")) ; A triple string is decoded and dedented, as Nix would. (bash """ one ${v} two literal ''${v} and ''' """) ; Heredocs keep their text, with interpolations as they are. (bash (cat > f (<< """ line $HOME ${v} indented EOF """)) (cat (<< "a") (<< "b\n")) (cat (<< "x\$${v}"))) (bash (cat (<< "'\$${v}"))) ; A script that starts indented stays a double-quoted string. (bash " indented") (bash (if (test -f x) (echo a)) (if "[[ -d x ]]" (do (echo b) (echo c)) (if ,v (echo d) (echo e)))) (bash (for :f [] (echo $f)) (for :f [,@xs *.txt] (echo $f) (echo again))) (bash (while (true) (break)) (case $x "a|b" (echo ab) * (do (echo any) (exit 1)))) (bash (defn :greet (echo hi $1)) (do (a) (b)) (sub (cd x) (make)) ((do (a)) > log) ((sub (b)) | tee out)) (bash ,(bash (echo inner)) "raw ${v}" make)]