English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 07 May 2021, 16:34   #1
npagonis73
Registered User

npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 273
Presenting shell output in nice requester

[http://www]
Nikos Pagonis

Posts 81

07 May 2021 13:28

Hi there
I was wondering how i can present the output of a command in a nice requester like the one coffin and you can see in the attached photo. That menu uses the RequestChoice command which then outputs its data to ReqAttack and produce that result. That technique is fine for small text outputs like the core info for example. When i use the same command for something that produces a lot more Info like the attached shell photo then i get the same nice requester but in a huge long form, from one side of the screen to the other and the info all in a straight line instead of one line below the other. Of course not all info is in there cause there is not enough space.
Any idea how i can achieve a nice presentation of the shell output?
Thanks

Last edited by npagonis73; 07 May 2021 at 16:56.
npagonis73 is offline  
Old 07 May 2021, 17:40   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,851
You need to add newline markers in the body text. E.g.: "Board information:*n*nProdukt-ID : 6*n..."
daxb is offline  
Old 07 May 2021, 20:53   #3
npagonis73
Registered User

npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 273
Hello Daxb!!!! Always available to help. Appreciate it mate. The thing is that all this information you see in the shell comes out with the following command "VControl Board" . I don't input all this by hand. The way you describe is correct and I have made a script inputting all this data by hand using the *n to separate every line. The alignment is never ok though but never mind. The point is that it is not automatic anymore and you can not use it to identify any vampire board.
npagonis73 is offline  
Old 07 May 2021, 22:01   #4
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,255
Maybe you could pass the output through a script/tool (like 'sed') to replace '\n' with '*n'
hooverphonique is offline  
Old 07 May 2021, 22:04   #5
npagonis73
Registered User

npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 273
Quote:
Originally Posted by hooverphonique View Post
Maybe you could pass the output through a script/tool (like 'sed') to replace '\n' with '*n'
I am not familiar with 'sed'. Could you give me an example maybe to try out?

Thanks
npagonis73 is offline  
Old 07 May 2021, 23:01   #6
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,255
Quote:
Originally Posted by npagonis73 View Post
I am not familiar with 'sed'.
I was just suggesting sed to indicate a type of tool which may be of help - sed is typically found on unix/linux systems. It's probably also available for amiga.


something like "sed -z 's/\n/*n/g'" will convert newline (\n) with *n.

Edit: Actually there is a very small version of sed on aminet by Thomas Richter, but I don't know if it supports -z, otherwise gnu versions are also available, but they are orders of magnitude larger.

Last edited by hooverphonique; 07 May 2021 at 23:30.
hooverphonique is offline  
Old 07 May 2021, 23:41   #7
npagonis73
Registered User

npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 273
Quote:
Originally Posted by hooverphonique View Post
I was just suggesting sed to indicate a type of tool which may be of help - sed is typically found on unix/linux systems. It's probably also available for amiga.


something like "sed -z 's/\n/*n/g'" will convert newline (\n) with *n.

Edit: Actually there is a very small version of sed on aminet by Thomas Richter, but I don't know if it supports -z, otherwise gnu versions are also available, but they are orders of magnitude larger.
Ok thank you hooverphonique, will have a look at it and let you know.

Take care
npagonis73 is offline  
Old 09 May 2021, 10:12   #8
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,148
No, SED doesn't support that. It only operates on entire lines. You can attach a *n to each end of line, however.

But there are other tricks. The shell knows how to escape newlines itself in variable expansions. That is, you could place the result in a variable and enclose the variable name in double quotes. This will perform the necessary escaping of the variable content by stars.
Thomas Richter is offline  
Old 09 May 2021, 19:45   #9
npagonis73
Registered User

npagonis73's Avatar
 
Join Date: Sep 2019
Location: Corfu / Greece
Posts: 273
Quote:
Originally Posted by Thomas Richter View Post
No, SED doesn't support that. It only operates on entire lines. You can attach a *n to each end of line, however.



But there are other tricks. The shell knows how to escape newlines itself in variable expansions. That is, you could place the result in a variable and enclose the variable name in double quotes. This will perform the necessary escaping of the variable content by stars.
Thomas thanks a lot for your help. Could you please write to me the command in order to get the output in a variable and how to use the double quotes? The command I run is VControl Board and that produces the shell output with all the infos. What comes after that?

Thanks again for your help

Nikos
npagonis73 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with Amiga Shell - quiting shell windows properly lost_lemming support.Apps 2 03 January 2021 19:37
Use file requester to specify path in Shell? Foebane support.Apps 5 01 January 2017 15:32
Clear background color for Shell window- Shell-StartUp fc.studio support.Apps 12 29 December 2009 14:21
Shell output to log file Bloodwych support.Apps 3 22 December 2009 14:03
Presenting!!.... *drum roll* Dastardly Amiga websites reviews 14 22 March 2004 23:06

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.08304 seconds with 14 queries