Skip to content

Commit ee7a32c

Browse files
committed
full 'tr' compliance
1 parent c65aa61 commit ee7a32c

6 files changed

Lines changed: 27 additions & 58 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ There are (sometimes old, please check easybashgui-x.x.x.tar.gz first! ) for som
7474

7575
## Credits.
7676

77-
* Thanks to Bash, Yad, Gtkdialog, Xdialog, Kdialog, Zenity, Gum, Cdialog, and Whiptail authors, this library was nothing without their work. Many thanks.
77+
* Thanks to Bash, Yad, Gtkdialog, Xdialog, Kdialog, Zenity, Qarma, Gum, Cdialog, and Whiptail authors, this library was nothing without their work. Many thanks.
7878
* Thanks to PICCORO McKAY Lenz for his efforts and *excellent* work on README (and bug hunting too).
7979
* Thanks to zen0bit for first try and README impulse revival.
8080
* Thanks to Frank Dietermann for suggestion though to make EBG "posix compliant" (since vers. 11.X.X )
@@ -92,5 +92,5 @@ https://github.com/BashGui/easybashgui
9292

9393
## LICENSE
9494

95-
GPLv3+, check [LICENSE](LICENSE) file!
95+
New BSD License, check [LICENSE](LICENSE) file!
9696

docs/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ transparently, based on the availability of the widget backends (frontends).
159159
* gtkdialog
160160
* kdialog
161161
* zenity
162+
* qarma
162163
* Xdialog
163164

164165
If there is no dialog/cdialog support installed. Check next section about `supermode`!
@@ -328,8 +329,9 @@ echo -e "What's your name?\n\nMy name's:\nVittorio" | text
328329

329330
It create a box window with such text and returns control to main program...
330331
during that you can made more commands, all of this time such box window with
331-
progress bar will be present while your following commands will be executed,
332-
after all of those job, you can close with an specific special function:
332+
progress bar will be present (if you don't like progress bar, use '-n' option)
333+
while your following commands will be executed, and after all of those job,
334+
you can close with an specific special function:
333335

334336
```bash
335337
source easybashgui
@@ -386,7 +388,7 @@ dir="${choices[2]}"
386388

387389
#### Progress bar
388390

389-
You can piped the progress count to a text of a box:
391+
You can pipe the progress count to a text of a box:
390392

391393
```bash
392394
source easybashgui
@@ -424,7 +426,7 @@ choice="$(0< "${dir_tmp}/${file_tmp}" )"
424426
#### Choose items
425427

426428
Same as menus but allows to choose more than one item to you,
427-
it's just elements and the selections will be in the temporally file;
429+
it's just elements and the selections will be in the temporary file;
428430

429431
```bash
430432
list "+Red" "-Yellow" "+Green"
@@ -454,7 +456,7 @@ done | progress "This is a _LOVE_ progress..." "${#women[@]}"
454456

455457
#### A notification example
456458

457-
This is only possible with Yad backend:
459+
This is *only* possible with Yad backend:
458460

459461
```bash
460462
source easybashgui
@@ -958,7 +960,7 @@ notify [-c "<command>"] [-i "<icongood|iconbad>"] [-t "<textgood|textbad>"] "<it
958960

959961
EasyBashGUI doesn't work with original "dialog" ( old one ) that is very limited; if you have first version "dialog" in your box, install "cdialog" and alias or link "dialog" to cdialog.
960962

961-
Since 5.0.0 version you can use EasyBashGUI even if NO WIDGET backend is installed (that is: no yad, no gtkdialog, no kdialog, no zenity, no Xdialog, no gum, no (c)dialog... doh!!!!! ). To use "super bare" EBG, simply remove the ".lib" library from your path, or set "supermode" var to "none" before easybashgui sourcing (e.g.: >export supermode="none" && source easybashgui && message "Hello world..." )
963+
Since 5.0.0 version you can use EasyBashGUI even if NO WIDGET backend is installed (that is: no yad, no gtkdialog, no kdialog, no zenity, no qarma, no Xdialog, no gum, no (c)dialog... doh!!!!! ). To use "super bare" EBG, simply remove the ".lib" library from your path, or set "supermode" var to "none" before easybashgui sourcing (e.g.: >export supermode="none" && source easybashgui && message "Hello world..." )
962964

963965
EasyBashGUI sets gtkdialog output statements as variables through "eval". This way, in theory, could be possibly dangerous; nevertheless, so far, I don't know about any alternative way...
964966

lib/easybashgui.lib

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
#
3-
#####################################
4-
#####################################
3+
##############################################################
4+
##############################################################
55
#
66
# EasyBashGUI allows you to use SAME script
77
# with yad, gtkdialog, kdialog, zenity, qarma, Xdialog, gum, (c)dialog, whiptail or bare bash !!!!
@@ -12,30 +12,19 @@
1212
#
1313
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1414
#
15-
# This program is free software; you can redistribute it and/or modify
16-
# it under the terms of the GNU General Public License as published by
17-
# the Free Software Foundation; version 3 of the License.
18-
#
19-
# This program is distributed in the hope that it will be useful,
20-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22-
# GNU General Public License for more details.
23-
#
24-
# You should have received a copy of the GNU General Public License along with this program,
25-
# called, in this distribution, "EasyBashGUI-license"; if not, write to the
26-
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
15+
# This program is free software: please, see file LICENSE along with this program.
2716
#
2817
#########################
2918
#
3019
# Dedicated to Angela, Nicole and Carlo.
3120
#
32-
# Vittorio Cagnetta
21+
# Vittorio Cagnetta
3322
# https://sites.google.com/site/easybashgui
3423
#
35-
#####################################
36-
#####################################
24+
##############################################################
25+
##############################################################
3726
#
38-
LIB_VERSION="15.0.0"
27+
LIB_VERSION="15.0.1"
3928
LIB_NAME="easybashgui.lib"
4029
LIB_URL="https://github.com/BashGui/easybashgui"
4130
LIB_AUTHOR="Vittorio Cagnetta"
@@ -1938,7 +1927,7 @@ if [ "${notify_send}" = "SI" ]
19381927
#
19391928
##############################
19401929
#
1941-
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc [[:digit:]] )
1930+
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc '[[:digit:]]' )
19421931
[ ${#notify_send_seconds_user} -gt 0 ] && \
19431932
notify_send_milliseconds=$(( ${notify_send_seconds_user} * 1000 )) || \
19441933
notify_send_milliseconds=$(( ${notify_send_seconds} * 1000 ))
@@ -1989,7 +1978,7 @@ elif [ "${notify_send}" = "NO" ]
19891978
#########################################
19901979
#
19911980
: notify_send_seconds
1992-
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc [[:digit:]] )
1981+
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc '[[:digit:]]' )
19931982
[ ${#notify_send_seconds_user} -gt 0 ] && \
19941983
notify_send_seconds_alt=${notify_send_seconds_user} || \
19951984
notify_send_seconds_alt=${notify_send_seconds}
@@ -2043,7 +2032,7 @@ elif [ "${notify_send}" = "NO" ]
20432032
#########################################
20442033
#
20452034
: notify_send_seconds
2046-
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc [[:digit:]] )
2035+
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc '[[:digit:]]' )
20472036
[ ${#notify_send_seconds_user} -gt 0 ] && \
20482037
notify_send_seconds_gum=${notify_send_seconds_user} || \
20492038
notify_send_seconds_gum=${notify_send_seconds}
@@ -2099,7 +2088,7 @@ elif [ "${notify_send}" = "NO" ]
20992088
##############################
21002089
#
21012090
: notify_send_seconds
2102-
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc [[:digit:]] )
2091+
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc '[[:digit:]]' )
21032092
[ ${#notify_send_seconds_user} -gt 0 ] && \
21042093
notify_send_seconds_else=${notify_send_seconds_user} || \
21052094
notify_send_seconds_else=${notify_send_seconds}
@@ -3545,7 +3534,7 @@ elif [ "${mode}" = "gum" ]
35453534
#
35463535
frame "${widget_color}" "$(echo -e "${window_title}\n(CTRL+D to finish)" )" && echo
35473536
file_input_content="$(0< "${file_input}" )"
3548-
file_input_lines=$(echo -e "${file_input_content}" | wc -l | tr -dc [[:digit:]] ); [ ${file_input_lines} -le 7 ] && gum_write_lines=7 || gum_write_lines=${file_input_lines}
3537+
file_input_lines=$(echo -e "${file_input_content}" | wc -l | tr -dc '[[:digit:]]' ); [ ${file_input_lines} -le 7 ] && gum_write_lines=7 || gum_write_lines=${file_input_lines}
35493538
echo -e "${file_input_content}" | gum write --height=${file_input_lines} --width=100 --char-limit=0 --placeholder "(CTRL+D to finish)" | tee "${dir_tmp}/${file_tmp}" | cat - 1>&2
35503539
#
35513540
elif [ ${#editable} -eq 0 ]

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9])
2-
VERSION=15.0.0
2+
VERSION=15.0.1
33

44
#cartelle di destinazione
55
DESTDIR ?= ""

src/easybashgui

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,7 @@
1616
#
1717
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1818
#
19-
# This program is free software; you can redistribute it and/or modify
20-
# it under the terms of the GNU General Public License as published by
21-
# the Free Software Foundation; version 3 of the License.
22-
#
23-
# This program is distributed in the hope that it will be useful,
24-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
25-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26-
# GNU General Public License for more details.
27-
#
28-
# You should have received a copy of the GNU General Public License along with this program,
29-
# called, in this distribution, "EasyBashGUI-license"; if not, write to the
30-
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19+
# This program is free software: please, see file LICENSE along with this program.
3120
#
3221
#########################
3322
#
@@ -698,7 +687,7 @@ elif [ "${eb_gui_fallback}" = "true" ]
698687
##############################
699688
#
700689
notify_send_seconds=4
701-
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc [[:digit:]] )
690+
[ ${#notify_send_seconds_user} -gt 0 ] && notify_send_seconds_user=$(echo "${notify_send_seconds_user}" | tr -dc '[[:digit:]]' )
702691
[ ${#notify_send_seconds_user} -gt 0 ] && \
703692
notify_send_seconds_none=${notify_send_seconds_user} || \
704693
notify_send_seconds_none=${notify_send_seconds}
@@ -1208,7 +1197,7 @@ elif [ "${eb_gui_fallback}" = "true" ]
12081197
not_correct_answer="YES"
12091198
#
12101199
else
1211-
if [ $(echo -n "${number}" | tr -dc [[:digit:]] | wc -c) -eq 0 ]
1200+
if [ $(echo -n "${number}" | tr -dc '[[:digit:]]' | wc -c) -eq 0 ]
12121201
then
12131202
#
12141203
not_correct_answer="YES"

src/easybashgui-debug

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,7 @@
1616
#
1717
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1818
#
19-
# This program is free software; you can redistribute it and/or modify
20-
# it under the terms of the GNU General Public License as published by
21-
# the Free Software Foundation; version 3 of the License.
22-
#
23-
# This program is distributed in the hope that it will be useful,
24-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
25-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26-
# GNU General Public License for more details.
27-
#
28-
# You should have received a copy of the GNU General Public License along with this program,
29-
# called, in this distribution, "EasyBashGUI-license"; if not, write to the
30-
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19+
# This program is free software: please, see file LICENSE along with this program.
3120
#
3221
#########################
3322
#

0 commit comments

Comments
 (0)