aboutsummaryrefslogtreecommitdiff
path: root/pb
diff options
context:
space:
mode:
Diffstat (limited to 'pb')
-rwxr-xr-xpb17
1 files changed, 7 insertions, 10 deletions
diff --git a/pb b/pb
index c4cdd38..cc91933 100755
--- a/pb
+++ b/pb
@@ -12,11 +12,8 @@ pb_nc () {
pb_fg () {
- if [ -z "$1" ] || [ "$1" -eq "$1" ] >/dev/null 2>&1; then
- true
- else
- echo "bad parameter";
- exit;
+ if [ -z "$1" ] || ! [ "$1" -eq "$1" ] >/dev/null 2>&1; then
+ return 1
fi
local x
@@ -26,15 +23,14 @@ pb_fg () {
printf %s "\033[38;5;$1m"
fi
+ return 0
+
}
pb_bg () {
- if [ -z "$1" ] || [ "$1" -eq "$1" ] >/dev/null 2>&1; then
- true
- else
- echo "bad parameter";
- exit;
+ if [ -z "$1" ] || ! [ "$1" -eq "$1" ] >/dev/null 2>&1; then
+ return 1
fi
local x
@@ -44,6 +40,7 @@ pb_bg () {
printf %s "\033[48;5;$1m"
fi
+ return 0
}
# end 256 colour functions