Welcome, Guest. Please login or register.

Author Topic: THOR's Shell Hacks  (Read 35088 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline kolla

Re: THORs Shell Hacks
« Reply #14 from previous page: December 04, 2017, 10:19:43 AM »
Digging up this old thread... :)

@ThoR

Instead of writing, let me just illustrate my question...

(and this doesn't even show all my desperate attempts at escaping)

I hope it is obvious what I try to accomplish? :)

My goal was to have the content of a file displayed as the body of RequestChoice.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: THORs Shell Hacks
« Reply #15 on: December 04, 2017, 02:28:10 PM »
Hm, so how do I make a variable that can subsitute "foo foo*nbar bar" in the below example, so that the requester pops up with two lines in body, like it does in the below example? I really tried using all your suggestions, and except for the last one, where it only expands to "foo foo" (the first line before line feed), all I ever get is literally "foo foo*nbar bar" (without quotes) in the body :)  

Code: [Select]
C:requestchoice title "test title" body "foo foo*nbar bar" gadgets "OK" "Cancel"

And worse yet - how to get the content of a file there, with linefeeds represented by "*n", using backticking? :)

Something that works, but isn't quite what I picture a solution...
Code: [Select]
set blarb foo foo
set blurb bar bar
requestchoice "testing" "${blarb}*n${blurb}" "OK"

so... with one variable per line, it works. But that is very cumbersome :)
« Last Edit: December 04, 2017, 03:50:55 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: THORs Shell Hacks
« Reply #16 on: December 05, 2017, 02:00:32 AM »
Thanks for all the thoughts and work you put into the shell updates!

And woop - found the solution - quotes inside the file :)

A file with content (including quotes):
Code: [Select]
"foo foo*nbar bar"and
Code: [Select]
echo `file`
vs a file with content (no quotes):
Code: [Select]
foo*nbarand (with or without quotes, makes no difference it seems)
Code: [Select]
echo "`type file`"
The first does work, the latter doesn't.

So, success - now I know how to alter files to show up as multiple lines with RequestChoice (still center aligned... hm) :)



(I really do an effort to just use ASL and not ReqTools etc)
« Last Edit: December 05, 2017, 02:02:59 AM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: THORs Shell Hacks
« Reply #17 on: December 07, 2017, 01:28:34 AM »
Quote from: LoadWB;833817
That's pretty neat.  Never used RequestChoice but I can see it being quite handy.


Yes it, plenty of room for more functionality though :)

As I mention, it center aligns, no matter, with fixed width fonts you can sort of work around it using some "invisble" character to have all lines equally long, but with normal fonts that gets messed up too. Would help if it understood tabs, for example.

Which reminds me - the shell has no concept of tabs, no *T :)

Btw, what I'm doing with this, is making a simple script with requesters for picking an available wifi network, parsing output from wpa_cli commands on "remote" (built into Amiga case) raspberry pi, via rsh (Thanks again, Olsen!). I try to avoid too much third party dependencies in my scripts, so they are more likely to work on all my systems, including the ones low on resources.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline kolla

Re: THORs Shell Hacks
« Reply #18 on: December 07, 2017, 05:04:30 AM »
That's just default ViNCEd config of OS3.9, I only set it to using ansi colours, which is why the background is black.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS