About 2,440,000 results
Open links in new tab
  1. shell - Bash regex =~ operator - Stack Overflow

    Oct 18, 2013 · What is the operator =~ called? I'm not sure it has a name. The bash documentation just calls it the =~ operator. Is it only used to compare the right side against the left side? The right side is …

  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" are pattern …

  3. Bash test: what does "=~" do? - Unix & Linux Stack Exchange

    Jan 27, 2017 · I realize you said “read the bash man pages” but at first, I thought you meant read the man pages within bash. At any rate, man bash returns a huge file, which is 4139 lines (72 pages) long.

  4. An "and" operator for an "if" statement in Bash - Stack Overflow

    Modern shells such as Bash and Zsh have inherited this construct from Ksh, but it is not part of the POSIX specification. If you're in an environment where you have to be strictly POSIX compliant, stay …

  5. How to compare strings in Bash - Stack Overflow

    Feb 10, 2010 · Bash always seemed backward with numeric evaluations using an operator consisting of a string (-eq) and string comparisons using a numeric operator "==" or "=" just you mess you up. If …

  6. How can I assign a heredoc value to a variable in Bash?

    This is also superior to the accepted answer, because it can be modified to support POSIX sh in addition to bash (a read loop in the function, to avoid the -d '' bashism necessary to preserve newlines).

  7. shell - Difference between sh and Bash - Stack Overflow

    When writing shell programs, we often use /bin/sh and /bin/bash. I usually use bash, but I don't know what's the difference between them. What's the main difference between Bash and sh? What do we ...

  8. sh - [: missing `]' in bash script - Stack Overflow

    Feb 9, 2016 · A bash function has no line numbers related to the FILE that contains the definition. NOW: The code is stored somewhere internally in the running instance of Bash - does it REALLY require a …

  9. bash if -a vs -e option - Stack Overflow

    Use -e . For single ' [', the bash builtin behaves the same as the test bash builtin, which behaves the same as /usr/bin/[ and /usr/bin/test (the one is a symlink to the other). Note the effect of -a depends …

  10. How to output a multiline string in Bash? - Stack Overflow

    Jun 10, 2012 · Then, I can make it a bash library, with unit tests and all, and import (source) it wherever needed, as I explain about bash libraries here: Detailed example: how do you write, import, use, and …