x is is x-cmd's value validation tool for checking if values or environment states meet specific criteria. Supports batch checking multiple values, ideal for robust Shell scripting.
Load x-cmd before use: bash
. ~/.x-cmd.root/X
x is int 42 100 -5 / x is float 3.14x is minmax 1 100 50 75x is eq "a" "a" / x is within "ok" pending successx is ip 192.168.1.1x is newest target src/*.c / x is oldest cache.txt /tmp/*.tmpx is unset VAR1 VAR2x is interactive / x is wsl / x is termuxCommandDescriptionintInteger check, batch supportedfloatFloat check (must contain decimal point)positivePositive integer (≥0)negativeNegative integer (<0)minmaxRange check [MIN,MAX]
CommandDescriptioneqMultiple values equalwithinFirst value in candidate listinColon-separated list member checkin-Dash-separated listin_Underscore-separated listin/Slash-separated listin|Pipe-separated list
CommandDescriptionipIPv4 address check
CommandDescriptionnewestFile newer than others (glob supported)oldestFile older than others (glob supported)
CommandDescriptionunsetVariable is unset
CommandDescriptioninteractiveInteractive sessioninteractive_ttystdin is interactive TTYinteractiveshellShell is interactivereplREPL modestdout2ttystdout outputs to TTYwslWSL environmentcygwinCygwin environmentmsysMSYS/MinGW environmentgitbashGit Bash environmenttermuxTermux environmentishiSH environment
CommandDescriptionsuitable_pkgSuitable for package installationsuitable_advise_envSuitable for advise featuresuitable_advise_replSuitable for advise REPL
bash
x is int 1 2 3 4 5 && echo "All integers"
x is float 3.14 -2.5 .5 && echo "All floats"
bash
x is interactive && echo "Interactive session" || echo "Script mode"
x is wsl && echo "WSL environment" || echo "Not WSL"
x is termux && echo "Termux environment"
bash
x is newest build.tar.gz src/*.c lib/*.h || echo "Rebuild needed"
bash
x is unset TEMP_VAR1 TEMP_VAR2 && echo "Temp variables cleaned"
bash
x is suitable_pkg || { echo "Environment not suitable"; exit 1; }
&&/ || chainsbash
x is --help