Comparing padded job counts

A Bash reporting utility receives job counts as text. Some records include leading zeros. Evaluate the following independent commands using Bash's test builtin, and enter exactly true or false for each expression. Report the truth value, rather than its numeric exit status.

  • A: test 008 -eq 8
  • B: test 008 = 8
  • C: test 14 -le 6
  • D: test 4 != 04
  • E: test 21 -ne 21
  • F: test 12 -gt 3

All operands are supplied literally as shown; no variables or arithmetic expansions are involved.

ExpressionTruth value
A
B
C
D
E
F

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Bash Expressions Questions: