![]() |
#91 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
2) Does not assume an error-free code path ; 3) Is a matter of good style ; 4) You can drop that "resets it to the default value" thing ; 4.a) Which might be an error - a function can't be certain it was set to the default value on entry ; 4.b) The value of IFS will be the same on exit as on entry. |
|
![]() |
![]() |
![]() |
#92 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
|
@twobob: working on your requested changes
@kc1: instead of dropping the reset to default value I'd rather save and restore the on-entry IFS value, just to bracket exactly the region where IFS=, needs to be in place. Any comments? |
![]() |
![]() |
Advert | |
|
![]() |
#93 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
local IFS does for you - no need to add any executable statements. |
|
![]() |
![]() |
![]() |
#94 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Sound fine mate. Heroic even. |
|
![]() |
![]() |
![]() |
#95 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
as a "use case"
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#96 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Sorry folks, not time to explain this morning, but . . . .
Another thing to control in the source is enable/disable "glob expansion" in the functions when using IFS and/or the built-in string operations. Keeps the dumb-dumb scripting language from trying (first) to turn the word expansion into a path or file name on the storage media. |
![]() |
![]() |
![]() |
#97 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
|
Quote:
Code:
json_parse() { local IFS0=$IFS IFS ... foo=$2 ... IFS=, ... IFS=$IFS0 $foo ... } Also is it safe to save $IFS and declare it local in a single statement, or should I break it into two lines Code:
local IFS0=$IFS local IFS ... |
|
![]() |
![]() |
![]() |
#98 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
|
Quote:
Spoiler:
edit: the forum is hiding multiple spaces in '| Run Gray' and similar labels... |
|
![]() |
![]() |
![]() |
#99 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Yeah. EDIT -> GO ADVANCED -> and like # (code blocks)
[code] stuff [/ code] As to your suggestions on name creation, feel free to implement your own suggestions. This is still just in the "testing" phase. I'm happy to take on suggestions, no doubt Ixtab would think the same thing. Thanks : ) |
![]() |
![]() |
![]() |
#100 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
|
Quote:
Code:
x=${s/[ \t][ \t]/ } edit: comes back... got it from your minimodding guide; use $'\t' instead of \t. Last edited by stepk; 01-22-2013 at 10:21 AM. Reason: SOLVED \t |
|
![]() |
![]() |
![]() |
#101 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
I really must run (car keys in hand) - but . . . . Here is a (somewhat large) example (in BASH!) of the handling of a lot of those issues: http://hg.minimodding.com/repos/cats/shacat.hg/ In particular the topmost defines for the IFS strings. That way a reader will get a clue as to what is happening at each step along the way. |
|
![]() |
![]() |
![]() |
#102 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
if it isn't on this page? http://linux.about.com/library/cmd/blcmdl1_ash.htm
Then I probably don't know it. Since my knowledge of scripting is postage stamp sized and my knowledge of ash is covered by that page. I too however am diving into some more docs. I'll give http://hg.minimodding.com/repos/cats...3/sha1cat.bash a look too ![]() |
![]() |
![]() |
![]() |
#103 | ||
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
err... is it like $'\t' ( so maybe something to do with the context of the escaping?)
[root@kindle extensions]# echo "Hey$'\t'You!" <- nope Quote:
Quote:
EDIT: LOL! I see you found it. Last edited by twobob; 01-22-2013 at 10:30 AM. |
||
![]() |
![]() |
![]() |
#104 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The fact that it takes 1200+ lines of supporting functions... Well, whatever. ![]() It can (has done) 1Tbyte disk drives with things nested in arbitrary order. (zips of tars of gzips of whatever). Any combination of the expand_<thing> that is posssible. I.E: My "Declarative Programming in Bash" example first published in the ABS Guide ten years ago. |
|
![]() |
![]() |
![]() |
#105 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
|
![]() |
![]() |
![]() |
Tags |
kindle touch, kindle touch hacks, kindlet, kual, launcher, launcher add-ons, paperwhite, sqlite, unified |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Launcher icon for KUAL? | Aeris | Kindle Developer's Corner | 32 | 04-01-2021 07:57 PM |
kite: kindle 3 application launcher | fbdev | Kindle Developer's Corner | 86 | 10-18-2017 10:19 AM |
[KUAL]Kindle reflective screen loader | icantbebothered | Kindle Developer's Corner | 26 | 10-27-2013 09:08 AM |
Kual shortcut for hidden image viewer (Kindle Touch & PW) | Aeris | Kindle Developer's Corner | 0 | 10-12-2013 05:09 AM |
application launcher for kindle 3 (kite) | fbdev | Kindle Developer's Corner | 21 | 05-04-2012 06:02 PM |