Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Oct 19, 2023
1 parent f890250 commit 351e60d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions notes/shells.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@
bash extension. In sh-compatible scripts only the single bracket must be used
(i.e. use the #!/bin/bash shebang line if using use double brackets)

# regular file - none of:
# directory, symbolic link, device, other special type

# bash: correctly handle empty strings or file names with spaces in them:
[ -f "$file" ] && printf -- "is a regular file\n" || printf -- "else ...\n"
[[ -f $file ]] && printf -- "is a regular file\n" || printf -- "else ...\n"
Expand Down

0 comments on commit 351e60d

Please sign in to comment.