Bitwise shift and the largest integer in Bash
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.
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.
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.
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:
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:
When I use the following, I get a result as expected:
I have a bash script that sets -e so the script will exit on any exit status != 0.
NOT x = −x − 1