bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

If Conditional Logic Error in Bash


From: Neko-san
Subject: If Conditional Logic Error in Bash
Date: Wed, 23 Nov 2022 10:31:43 +0000

Example:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=unreal-engine&id=c866141788f5c52cd32ddfaea3e8f5f5ca57b3ae#n135

There's a logic bug at play in Bash where having a value optionally be either a 
string (in this case true/false) or an integer, checked by an if statement, can 
throw an error claiming that an integer is expected even though a || operator 
is used to make integers optional.

The example above uses Arch Linux's "PKGBUILD" format, but this is irrelevant 
because it's actually just a bash script that's fed to Arch's "makepkg" and 
executed with bash.

Additional info:
* Arch Linux Package version (for reference): 5.1.016-1 * Error message:

line 135: [: false: integer expression expected.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]