From 7cb4d8944f37362b4579bcc5054e954e6701b49b Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Thu, 25 Mar 2021 11:53:28 +0100 Subject: Update bash --- bash.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bash.md') diff --git a/bash.md b/bash.md index d150702..41e8f05 100644 --- a/bash.md +++ b/bash.md @@ -29,6 +29,27 @@ Loop over integers ## Conditionals * `-z`: is empty string +* `-n`: non-empty string * `-f`: is regular file * `$A == $B`: string equality, accepts globs * `$A != $B`: string inequality + +## Heredocs + + cat << EOF > file + bla bla + EOF + +Ignoring the initial indent: + + ... + cat <<- EOF > file + bla bla + EOF + ... + +Don't interpolate variables: + + cat << 'EOF' > file + bla bla + EOF -- cgit v1.2.3