Linux

The ‘expr’ Command In Linux



Become A Channel Member:

[ad_2]

source

Related Articles

34 Comments

  1. I stopped worrying about escaping after I learned python. My hot take in situation where expr needed in bash script, bash script should be rewritten in python. For calculator I also use python instead of expr, bc, dc, etc.

  2. Hmm, for actual shell scripting this command might be nice indeed, although usually expressions are already understood by bash directly.
    But for direct use I rather use something like the Python or Node shell, or a calculator to do the job, which all don't have the escaping problem.

  3. Time to read the manual page. I had dismissed expr as just a poor alternative to Bash arithmetic expansion, but it also does string operatons and regex?? Wonder what uses I've been missing… Thanks for the short!

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button