English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 26 December 2017, 21:18   #21
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by kolla View Post
You would think, right? Just a list dirs with lformat, and voila?
Except, only dirs with corresponding .info files are wanted.

Also, it might explain why you may find files named just ".info" here and there
If you want to exclude dirs not already having a .info, it indeed becomes more complicated.
I don't know the ProcessIcon command so i can't tell if it has an option to avoid processing icons that don't exist.
Doing it by script might involve calling an intermediate script, which uses if exists / endif pairs. Seems still doable.
meynaf is offline  
Old 26 December 2017, 21:30   #22
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
More precisely, it would look this way :
Code:
list dirs lformat "script2 *"%s*"" >script1
execute script1
With "script2" having the "s" bit set and looking like this :
Code:
.key dir/a
.bra {
.ket }

if exists "{dir}.info"
echo {dir}
endif
(where you replace "echo" i used to list them, with any command you wish)

There is perhaps a simpler way, but it works at least for listing them
meynaf is offline  
Old 26 December 2017, 21:53   #23
jPV
Registered User
 
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 1,006
Quote:
Originally Posted by meynaf View Post
Doing it by script might involve calling an intermediate script, which uses if exists / endif pairs. Seems still doable.
That can also be done in a single line, no need for intermediate scripts :P
Code:
list dirs lformat "if exists *"%p%n.info*"*Necho %p%n*Nendif"
jPV is offline  
Old 27 December 2017, 10:50   #24
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
I guessed it was probably possible, I just didn't know we could issue a newline with *N
meynaf is offline  
Old 19 March 2018, 10:13   #25
kolla
Banned
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 1,893
Just want point out to people who may not know about it, this little gem by ThoR:

http://aminet.net/package/util/cli/SED

_very_ handy for editing and formatting text output from commands and whatnot. It's not unix sed, but fills the same purpose, only using more Amiga like syntax and pattern matching.
kolla is offline  
Old 19 March 2018, 10:48   #26
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Oh yes, I used that quite a lot before. Much better than Unix SED.
idrougge is offline  
Old 19 March 2018, 14:51   #27
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: UmeƄ
Age: 43
Posts: 922
Quote:
Originally Posted by meynaf View Post
I guessed it was probably possible, I just didn't know we could issue a newline with *N
ReadArgs() transforms *N to a newline.
patrik 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
UAE Scripting Layer FrodeSolheim support.FS-UAE 15 26 January 2014 15:56
C= 64 BASIC as a Scripting Language Charlie Retrogaming General Discussion 2 17 November 2008 14:23
AmigaDOS 1.3 Scripting Language redblade Coders. General 10 16 August 2008 12:58
Resources?? DDNI project.WHDLoad 5 25 April 2007 20:42

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 01:37.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09438 seconds with 15 queries