About 50 results
Open links in new tab
  1. bash - Using expr, $ ( ()), ( ()) - Unix & Linux Stack Exchange

    Here the expression will be calculated by the program expr, which isn't a shell builtin but an external Unix program. So instead of simply adding 1 and s a program must be started und its output must be …

  2. Adding two numbers using expr - Unix & Linux Stack Exchange

    expr is an external program used by Bourne shell (i.e. sh). Bourne shell didn't originally have any mechanism to perform simple arithmetic. It uses expr external program with the help of backtick. The …

  3. shell - Parenthesis in expr arithmetic: 3 * (2 + 1) - Unix & Linux ...

    Aug 13, 2014 · Thus: expr 3 \* \( 2 + 1 \) Unless you're working on an antique unix system from the 1970s or 1980s, there is very little reason to use expr. In the old days, shells didn't have a built-in …

  4. What is expr doing when processing arrays? - Unix & Linux Stack …

    Nov 26, 2024 · 1 Expr is a command line tool, it is independent from the bash. It does not know anything about arrays. It gets command line arguments, exactly those what we refer as $1, $2, $3 etc in our …

  5. shell script - OR in `expr match` - Unix & Linux Stack Exchange

    Dec 14, 2015 · I'm confused as to why this does not match: expr match Unauthenticated123 '^(Unauthenticated|Authenticated).*' it outputs 0.

  6. [: expr: unexpected operator - Unix & Linux Stack Exchange

    Oct 18, 2020 · Did you create the file on Windows and then copy it to your UNIX/Linux platform, or is the entire exercise on UNIX/Linux?

  7. Why should I use $ [ EXPR ] instead of $ ( ( EXPR ))?

    to be quite honest, I am not sure this answers the question. Basically the linked bash documentation says exactly the opposite: use $(()) instead of $[] giving the reason of the former being deprecated. …

  8. Substring extraction with expr - Unix & Linux Stack Exchange

    Dec 2, 2015 · man expr says the "STRING : PATTERN" expression is "anchored", and then in the info page (info coreutils 'expr invocation') you can read: `STRING : REGEX' Perform pattern matching. …

  9. Understanding of the regexp match feature of the expr utility

    Apr 11, 2022 · For the first command, it seems expr found a match from the first character of abc and reports the matched length. But why does it produce 0 for the second command?

  10. Bash multiplication and addition - Unix & Linux Stack Exchange

    Jul 31, 2016 · @Theophrastus: As suggested it works fine but what if i wanted to use expr instead of ( ()).