Comments (3)
Indeed, the comment is likely incorrect. For the standard single-bracket test
("["), POSIX.1-2008 specifies the following behavior, which precludes a single
argument being interpreted as a test flag:
In the following list, $1, $2, $3, and $4 represent the arguments presented to test:
...
1 argument:
Exit true (0) if $1 is not null; otherwise, exit false.
bash's "[[" appears to behave the same way (even when ${my_var} is not quoted,
as field splitting and pathname expansion are not performed inside [[ ]]).
Original comment by [email protected]
on 15 May 2014 at 3:47
from styleguide.
this is likely obsolete. the current shell style guide tells people to use explicit -z
and -n
for clarity purposes. which is what we want. implicit empty string tests are bad form.
from styleguide.
To avoid confusion about what you're testing for, explicitly use -z or -n.
from styleguide.
Related Issues (20)
- Please consider maintaining the Emacs-Lisp files in a separate repository
- cpplint.py write error HOT 2
- cpplint false positive [readability/braces] with requires expression (C++20)
- Contradiction between C++ styleguide and cpplint regarding transitive includes HOT 1
- Google style HOT 1
- github.com/@GuilaMonstar HOT 2
- Neotree and google-c-style.el default to standard indentation in C++
- Usar OAuth 2.0 para aplicaciones de servidor web | Authorization | Google Developers
- Go: update `interface{}` to `any` HOT 2
- unclear include order in C headers
- Style guide foe MarkDown files
- Style guide by google? Is this a joke? HOT 1
- Google style guide
- Google style
- N8-J
- Google Style HOT 1
- FYI: the diamond problem is solved! HOT 2
- Any plans for the l10n?
- styleguide.css doesn't follow https://google.github.io/styleguide/htmlcssguide.html HOT 1
- Broken link in style guide HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from styleguide.