File: __boolstr

package info (click to toggle)
mongo-c-driver 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 47,088 kB
  • sloc: ansic: 193,670; python: 7,780; cpp: 1,493; sh: 659; makefile: 78
file content (15 lines) | stat: -rw-r--r-- 348 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh

# Execute the given argument list as a command. If exits zero, prints "true",
# otherwise "false". stdout from the subcommand will be supressed. stderr will
# be forwarded. This script itself will always exit zero.

# Usage: __boolstr [cmd...]

"$@" 1>/dev/null

if test $? = 0; then
    printf "true"
else
    printf "false"
fi