Stack Overflow for Teams is moving to its own domain! When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on stackoverflow.com.
Check your email for updates.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
As far as I know, square brackets are used to enclose an expression usually in if else statements.
But I found square brackets being used without the "if" as follows:
[ -r /etc/profile.d/java.sh ] &...
I need to check the command executed is success or not, I have place the below code in test.sh run it, which give the out by listing the content of /home but there is a warning
./test.sh: 3: ./test....
I am a little bit confused on what do these operators do differently when used in bash (brackets, double brackets, parenthesis and double parenthesis).
[[ , [ , ( , ((
I have seen people use them on ...
The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $...
Read that for comparing strings inside if we need to use double square brackets. Some books says that comparison can be done by =. But it works with the == too.
if [[ $...
I want to check, from the linux command line, if a given cleartext password is the same of a crypted password on a /etc/shadow
(I need this to authenticate web users. I'm running an embedded linux.)