Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

arithmetic

Bitwise shift and the largest integer in Bash

August 10, 2022 by Magenaut

This is an exploration question, meaning I’m not completely sure what this question is about, but I think it’s about the biggest integer in Bash. Anyhow, I’ll define it ostensively.

Categories Q&A, Unix & Linux Tags arithmetic, bash Leave a comment

Check if $REPLY is in a range of numbers

August 10, 2022 by Magenaut

I’m writing a shell script for Linux, using Bash, to translate any video-file into a MP4. For that, I’m using avconv with libvorbis for audio.

Categories Q&A, Unix & Linux Tags arithmetic, bash, shell-script Leave a comment

What is the rationale for the bash shell not warning you of arithmetic overflow etc.?

August 10, 2022 by Magenaut

There are limits set for the arithmetic evaluation capabilities of the bash shell. The manual is succinct about this aspect of shell arithmetic but states:

Categories Q&A, Unix & Linux Tags arithmetic, bash, shell Leave a comment

Why does a=0; let a++ return exit code 1?

August 9, 2022 by Magenaut

Try it:

Categories Q&A, Unix & Linux Tags arithmetic, bash, ksh Leave a comment

Bash: double equals vs -eq

August 9, 2022 by Magenaut

I am doing integer comparison in bash (trying to see if the user is running as root), and I found two different ways of doing it:

Categories Q&A, Unix & Linux Tags arithmetic, bash, shell Leave a comment

How to create a sequence with leading zeroes using brace expansion

August 9, 2022 by Magenaut

When I use the following, I get a result as expected:

Categories Q&A, Unix & Linux Tags arithmetic, bash, brace-expansion Leave a comment

bash -e exits when let or expr evaluates to 0

August 8, 2022 by Magenaut

I have a bash script that sets -e so the script will exit on any exit status != 0.

Categories Q&A, Unix & Linux Tags arithmetic, bash, exit, scripting Leave a comment

How do I remove leading zeroes from output of ‘date’ or avoid octal interpretation of such decimal numbers?

August 7, 2022 by Magenaut

I have this:

Categories Q&A, Unix & Linux Tags arithmetic, bash, date, shell Leave a comment

Why does “$(( ~33 ))” produce -34?

August 6, 2022 by Magenaut

NOT x = −x − 1

Categories Q&A, Unix & Linux Tags arithmetic, bash, shell Leave a comment
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress