# |
Date |
Size |
|
Editor |
Comment |
Action |
56 |
2025-01-23 23:55:16 |
5745 |
to previous |
larryv |
undid rev 55 (quotes are unnecessary around the word following `case`) |
view |
55 |
2025-01-23 23:47:40 |
5751 |
to previous |
81 |
Add quotes around variables |
view |
54 |
2022-08-01 10:02:57 |
5745 |
to previous |
89 |
fixed quoting, in "else printf ..." below "Bash version 3 and above have..." |
view |
53 |
2022-04-19 05:23:33 |
5741 |
to previous |
emanuele6 |
clarify that that enabling the extglob shopt is not necessary to use extglob patterns inside of [[ in bash4.1 |
view |
52 |
2022-04-19 05:17:39 |
5743 |
to previous |
emanuele6 |
remention shopt-sextglob, but add comment about shopt not being necessary in ksh. add syntax highlighting. echo -> printf. fix indentation. `{{{ a}}}' -> ` {{{a}}}' |
view |
51 |
2022-04-19 04:14:49 |
5503 |
to previous |
emanuele6 |
remove "shopt -s extglob" from Bash/ksh example: shopt doesn't exist in ksh and is not necessary in bash. |
view |
50 |
2020-10-15 10:20:40 |
5521 |
to previous |
StephaneChazelas |
|
view |
49 |
2020-10-15 10:17:02 |
5495 |
to previous |
StephaneChazelas |
several corrections. |
view |
48 |
2016-02-28 14:27:15 |
4801 |
to previous |
izabera |
printf %f 0x10 returns 0 |
view |
47 |
2016-02-06 03:08:22 |
4660 |
to previous |
larryv |
fixed typo |
view |
46 |
2015-03-01 21:43:37 |
4659 |
to previous |
geirha |
bashfaq is brittle about empty lines |
view |
45 |
2015-03-01 16:03:15 |
4661 |
to previous |
pdm-l03 |
|
view |
44 |
2015-02-16 13:01:43 |
4174 |
to previous |
TripleEe |
Demonstrating how to combine cases in "case" |
view |
43 |
2015-02-16 12:58:49 |
3981 |
to previous |
TripleEe |
Second "case" also demonstrates disallowing multiple decimal points |
view |
42 |
2015-02-16 12:51:56 |
3893 |
to previous |
TripleEe |
In case statement, you can trim any prefix sign; fix a couple of minor formatting errors |
view |
41 |
2015-01-12 10:10:09 |
3514 |
to previous |
geirha |
= rather than ==, for consistency |
view |
40 |
2015-01-12 00:55:54 |
3515 |
to previous |
GreyCat |
The proposed change is incorrect. |
view |
39 |
2015-01-11 22:54:10 |
3513 |
to previous |
112 |
|
view |
38 |
2014-05-04 22:03:53 |
3515 |
to previous |
ormaaj |
oops |
view |
37 |
2014-05-04 22:01:39 |
3453 |
to previous |
ormaaj |
Adding the case of a bare +/- or empty doesn't complicate things much (I think). Needs testing. |
view |
36 |
2014-05-02 14:28:21 |
3574 |
to previous |
ormaaj |
Fix some bugs. ksh has always supported [[. rm'd example. =~ shouldn't be shunned due to bash 3's bad implementation. rm'd (again). =~ (and [[) will quite likely be POSIX at some point. |
view |
35 |
2014-05-02 13:25:28 |
4036 |
to previous |
ormaaj |
POSIX doesn't require %f. Some shells printf(1) (ksh/zsh) evaluate arithmetic. Unlike C varargs functions (like printf), they may perform implicit conversion to float successfully. |
view |
34 |
2013-08-17 22:52:06 |
3995 |
to previous |
187 |
Remove crappy (("$foo")) suggestion. See: http://sprunge.us/BThD |
view |
33 |
2012-12-02 11:27:59 |
4276 |
to previous |
geirha |
toc broken again |
view |
32 |
2012-12-02 02:34:38 |
4278 |
to previous |
S01060048548a70fe |
|
view |
31 |
2012-10-24 17:34:14 |
4015 |
to previous |
ormaaj |
rm the entire "declare -i" section with dangerous examples. declare -i is NOT a method of testing for valid integers. It requires extra care - not recommended for beginners. |
view |
30 |
2012-05-11 20:51:25 |
5804 |
to previous |
e36freak |
typo correction, incorrect variable name |
view |
29 |
2012-04-04 22:41:19 |
5801 |
to previous |
GreyCat |
"Using eq" was already in the page. Add that phrase to the section header for emphasis. |
view |
28 |
2012-04-04 12:28:37 |
5955 |
to previous |
GrzegorzRumatowski |
eq method added |
view |
27 |
2012-04-04 11:51:59 |
5785 |
to previous |
Lhunath |
The eq operator is covered by the [ and printf section. |
view |
26 |
2012-04-04 11:48:57 |
5846 |
to previous |
oberon-i |
eq method added |
view |
25 |
2011-10-04 06:59:36 |
5785 |
to previous |
dialup-4 |
one RE does it all |
view |
24 |
2011-06-29 14:24:47 |
6034 |
to previous |
irc2samus |
if you're validating it's more natural to have the desired outcome on the "true" part of the if block |
view |
23 |
2011-04-11 21:16:06 |
6033 |
to previous |
109 |
|
view |
22 |
2010-02-24 14:48:18 |
6033 |
to previous |
kurkale6ka |
The second star IS actually needed, otherwise a pattern like test1234 would fail |
view |
21 |
2010-02-24 14:07:50 |
6029 |
to previous |
webgw1 |
The second star isn't needed |
view |
20 |
2010-02-24 14:03:45 |
6032 |
to previous |
webgw1 |
The second star isn't needed |
view |
19 |
2010-01-15 23:59:45 |
6033 |
to previous |
GreyCat |
restore some deleted content; clean up the previous "clean-up" |
view |
18 |
2010-01-15 20:30:25 |
5228 |
to previous |
ppp089210037022 |
a bit of clean, add the solutions using [ and printf |
view |
17 |
2008-11-22 21:55:28 |
6058 |
to previous |
GreyCat |
first-line |
view |
16 |
2008-11-22 14:08:29 |
6060 |
to previous |
localhost |
converted to 1.6 markup |
view |
15 |
2008-06-14 01:39:12 |
6054 |
to previous |
GreyCat |
|
view |
14 |
2008-06-13 18:51:30 |
6054 |
to previous |
74-140-161-210 |
mention read's arithmetic evaluation |
view |
13 |
2008-05-02 12:55:51 |
5780 |
to previous |
GreyCat |
clean up (including the ridiculous error in the almighty xmb's example) |
view |
12 |
2008-05-02 11:03:52 |
5644 |
to previous |
194 |
added shopt -s extglob |
view |
11 |
2008-03-06 14:13:49 |
5498 |
to previous |
GreyCat |
expand on "declare integer" |
view |
10 |
2008-03-06 04:59:38 |
4676 |
to previous |
pgas |
move the declare -i stuff down as it is a bit different, change the examples |
view |
9 |
2008-03-06 04:51:54 |
4550 |
to previous |
pgas |
a word about arithmetic with declare -i |
view |
8 |
2008-03-05 21:43:20 |
4430 |
to previous |
cpe-74-65-28-251 |
Made mention of the integer attribute for variables |
view |
7 |
2007-07-30 13:36:51 |
4055 |
to previous |
GreyCat |
move that extglob solution up above the regex ones; add a ksh-based one too; clean up a lot |
view |
6 |
2007-07-28 04:53:56 |
2698 |
to previous |
ppp020-014 |
add matching with extglob |
view |
5 |
2007-07-13 15:39:25 |
2537 |
to previous |
GreyCat |
screw it. put the egrep one FIRST, because it actually works. insert warnings. leave the bash ones in, after the warnings. |
view |
4 |
2007-07-13 15:33:11 |
2260 |
to previous |
GreyCat |
gods, what a fucking mess. |
view |
3 |
2007-07-11 22:25:22 |
1554 |
to previous |
cpe-74-65-28-251 |
Fixed broken escaping |
view |
2 |
2007-05-07 18:02:07 |
1556 |
to previous |
GreyCat |
[0-9]* before the decimal, not [0-9]+, so we can have .5 as a number. This requires checking non-blank-ness. |
view |
1 |
2007-05-02 23:46:43 |
1429 |
|
redondos |
|
view |