About 1,200,000 results
Open links in new tab
  1. An "and" operator for an "if" statement in Bash - Stack Overflow

    An "and" operator for an "if" statement in Bash Asked 13 years, 2 months ago Modified 1 year, 6 months ago Viewed 995k times

  2. bash - Shell equality operators (=, ==, -eq) - Stack Overflow

    If not quoted, it is a pattern match! (From the Bash man page: "Any part of the pattern may be quoted to force it to be matched as a string."). Here in Bash, the two statements yielding "yes" …

  3. if statement - How to use if elif else in bash - Stack Overflow

    Aug 2, 2021 · How to use if elif else in bash Asked 4 years, 5 months ago Modified 1 year, 8 months ago Viewed 325k times

  4. shell - How can I compare numbers in Bash? - Stack Overflow

    BTW, in bash a semi-colon is a statement separator, not a statement terminator, which is a new-line. So if you only have one statement on a line then the ; at end-of-line are superfluous. Not …

  5. bash - How to represent multiple conditions in a shell if statement ...

    Sep 30, 2010 · Bash (see conditional expressions) seems to preempt the classic and POSIX meanings for -a and -o with its own alternative operators that take arguments. With some care, …

  6. In a bash script, using the conditional "or" in an "if" statement

    In a bash script, using the conditional "or" in an "if" statement Ask Question Asked 13 years, 4 months ago Modified 1 year, 1 month ago

  7. bash - Difference between 'if -e' and 'if -f' - Stack Overflow

    Apr 18, 2012 · 60 $ man bash -e file True if file exists. -f file True if file exists and is a regular file. A regular file is something that isn't a directory, symlink, socket, device, etc.

  8. bash - Is there a list of 'if' switches anywhere? - Stack Overflow

    5 They are not switches for the if statement, but for the test command ([ is a synonym for the test builtin). See help test in Bash for a complete list.

  9. if statement - What is the difference between single and double …

    Nov 24, 2012 · Tested in Bash 4.3.11: POSIX vs Bash extension: [ is POSIX [[ is a Bash extension inspired from Korn shell regular command vs magic [ is just a regular command with …

  10. How can I declare and use Boolean variables in a shell script?

    To explain what is happening: the if statement is executing the contents of the variable which is the Bash builtin true. Any command could be set as the value of the variable and its exit value …