-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
139 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: siakhooi-textutils | ||
Version: 1.2.0 | ||
Version: 1.3.0 | ||
Maintainer: Siak Hooi <siakhooi@gmail.com> | ||
Depends: coreutils, bash | ||
Depends: coreutils, bash, findutils | ||
Architecture: amd64 | ||
Homepage: <https://github.com/siakhooi/bash-textutils> | ||
Description: commands to transform line of texts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
[[ $# -ne 1 ]] && exit 1 | ||
|
||
T=$(echo "$*" | xargs | tr '[:lower:]' '[:upper:]') | ||
|
||
[[ $T == 'N' ]] && exit 0 | ||
[[ $T == 'NO' ]] && exit 0 | ||
[[ $T == 'F' ]] && exit 0 | ||
[[ $T == 'FALSE' ]] && exit 0 | ||
[[ $T == 'OFF' ]] && exit 0 | ||
[[ $T == '0' ]] && exit 0 | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
[[ $# -ne 1 ]] && exit 1 | ||
|
||
T=$(echo "$*" | xargs | tr '[:lower:]' '[:upper:]') | ||
|
||
[[ $T == 'Y' ]] && exit 0 | ||
[[ $T == 'YES' ]] && exit 0 | ||
[[ $T == 'T' ]] && exit 0 | ||
[[ $T == 'TRUE' ]] && exit 0 | ||
[[ $T == 'ON' ]] && exit 0 | ||
[[ $T == '1' ]] && exit 0 | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
% IS-FALSE(1) Siak Hooi TextUtils 1.1.0 |Text Utils | ||
% Siak Hooi | ||
% March 2023 | ||
|
||
# NAME | ||
is-false - check if a value is false/no/off/N/F/0 | ||
|
||
# SYNOPSIS | ||
**is-false** value | ||
|
||
# DESCRIPTION | ||
Check if a value is false/no/off/N/F/0, case insensitively, return 0, otherwise return 1. | ||
|
||
# EXAMPLES | ||
$ is-false off && echo yes | ||
: yes | ||
|
||
$ is-false on || echo no | ||
: no | ||
|
||
# EXIT CODE | ||
|
||
**0** | ||
: if value is one of the following (case insensitive): false, no, off, N, F, 0 | ||
|
||
**1** | ||
: if there are 0 argument, or more than 1 argument, or the value is not one of the above. | ||
|
||
# LICENSE | ||
MIT | ||
|
||
# BUGS | ||
Report bugs at https://github.com/siakhooi/bash-textutils/issues. | ||
|
||
# SEE ALSO | ||
siakhooi-textutils(1), is-true(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
% IS-TRUE(1) Siak Hooi TextUtils 1.1.0 |Text Utils | ||
% Siak Hooi | ||
% March 2023 | ||
|
||
# NAME | ||
is-true - check if a value is true/yes/on/Y/T/1 | ||
|
||
# SYNOPSIS | ||
**is-true** value | ||
|
||
# DESCRIPTION | ||
Check if a value is true/yes/on/Y/T/1, case insensitively, return 0, otherwise return 1. | ||
|
||
# EXAMPLES | ||
$ is-true on && echo yes | ||
: yes | ||
|
||
$ is-true off || echo no | ||
: no | ||
|
||
# EXIT CODE | ||
|
||
**0** | ||
: if value is one of the following (case insensitive): true, yes, on, Y, T, 1 | ||
|
||
**1** | ||
: if there are 0 argument, or more than 1 argument, or the value is not one of the above. | ||
|
||
# LICENSE | ||
MIT | ||
|
||
# BUGS | ||
Report bugs at https://github.com/siakhooi/bash-textutils/issues. | ||
|
||
# SEE ALSO | ||
siakhooi-textutils(1), is-false(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters