08 January 2019, 11:38 | #1 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
AmigaDOS command - CUT
Hi,
I would like to use the 'Cut' command as described at: https://wiki.amigaos.net/wiki/AmigaO..._Reference#CUT This is not an internal command, but I can't find command this in the C: directory of my ClassicWB-LITE setup. And I can't seem to find it on Aminet. I've noticed that another command that is listed in this Wiki was also missing - 'Foreach', but I did manage to eventually find it on Aminet (http://aminet.net/package/util/cli/finkelshelltoo). Is there a good repository of the AmigaDOS commands listed in wiki? Other than setting up the other ClassicWB versions and checking. But I found that these other versions - P96 and OS39 - did not have the 'Foreach' command in them either. I have not yet tried setting up ClassicWB FULL, ADV and ADVSP to check for these commands. Cheers! |
08 January 2019, 13:14 | #2 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
Hi,
I've got a workaround for now. I wanted the CUT version as documented in wiki, which processes 'strings', but I found this CUT version on aminet which processes 'files': http://aminet.net/package/util/cli/ksc_Cut Since I was looking to use CUT on environment variables, and I am/can accessing these variables as 'files' in ENV: or RAM:, then it can be used in a similar way. So this CUT command from aminet will do for now - although I had to still figure out how to get the length of the string/file and ended up using 'LIST' with the lformat 'L%' option (Prints the length of the file in bytes). (If there is a better way of doing this then please let me know) I would still like to know a good resource for the AmigaDOS mentioned in the wiki. Cheers! Last edited by solarmon; 08 January 2019 at 14:49. |
08 January 2019, 14:33 | #3 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
I think the problem is that the command are OS4 only? At least I guess so. For OS3 the AmigaDOS book is a good reference. Some cut down DOS command list/description can be found on Aminet.
A better way of string manipulation can be achieved with https://wiki.amigaos.net/wiki/AmigaOS_Manual:_ARexx A good offline ARexx reverence is ARexxGuide: http://aminet.net/search?query=arexxguide There you can find a section of string manipulation. It is much more powerful. |
08 January 2019, 14:47 | #4 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
Hi daxb,
Yes, on the main page, it does state that it is for AmigaOS 4.0 and beyond: https://wiki.amigaos.net/wiki/Main_Page I wish it stated this on their AmigaDOS command page itself too! I'm looking to use these commands in a minimal startup-sequence and setup (as part of a WHDLoad launcher) - so I probably don't want at add too much to it? Do you know what are the minimum requirements to support ARexx scripting? Cheers! |
08 January 2019, 15:05 | #5 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Requirements: More or less RexxMast running. See also https://wiki.amigaos.net/wiki/AmigaO...etting_Started In Libs should be rexxsyslib.library and rexxsupport.library. On an OS3 install they already exists.That's all. Of course you can use more libraries but not needed.
|
08 January 2019, 16:35 | #6 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
Thanks for the pointers!
If I get really stuck on using standard AmigaOS commands (that might just be down to inexperience) then I'll take a look at Arexx. Thanks for your help. Cheers! |
08 January 2019, 17:23 | #7 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
You can use the Echo command on OS3.x setups for the same. At least on OS3.9, not that sure about 3.1 or so... but take a look at the documentation for example here (check the FIRST and LEN options to cut a substring).
|
08 January 2019, 20:25 | #8 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
Yes, I eventually did realise that ECHO had these FIRST and LEN options. I still need to get the length of the string/file because I wanted to strip the last character from the string/file. (Is there a better way to get the length of a string/file than using List?)
But, using the internal ECHO command might be technically quicker than using an external command? So I might change my script to make use of ECHO instead. And it is one less command that I need to put in C:. Cheers! |
09 January 2019, 02:15 | #9 | |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
Quote:
http://eab.abime.net/zone/Cut.zip Last edited by AMIGASYSTEM; 13 January 2019 at 19:08. |
|
09 January 2019, 10:16 | #10 |
Registered User
Join Date: Dec 2018
Location: UK
Posts: 1,715
|
@AMIGASYSTEM,
The CUT command was missing because this seems to only be on OS 4.0 and above. Cheers! Last edited by solarmon; 09 January 2019 at 13:09. |
09 January 2019, 10:36 | #11 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
No, the screnshot system is OS 3.9 , successfully tested the cut command also with OS 2.x and 3.x
|
09 January 2019, 12:17 | #12 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
|
But it's not part of a standard 3.9, 3.x or 2.x installation. The OP had already added a separate replacement version of the CUT command.
|
09 January 2019, 12:51 | #13 | |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Quote:
Code:
rx "say LENGHT('hello')" rx "say LEFT('hello', 4)" Code:
rx "say LEFT('hello', LENGTH('hello')-1)" or rx "str='hello'; say LEFT(str, LENGTH(str)-1)" |
|
09 January 2019, 13:44 | #14 |
Registered User
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
|
|
09 January 2019, 14:33 | #15 | ||
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Quote:
Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cut down re-released games? | PopoCop | support.Games | 10 | 03 September 2017 19:53 |
Hello (Director's cut:) | Cobe | Member Introductions | 3 | 21 October 2014 12:40 |
AmigaDOS: call several commands in a single command line | pintcat | Coders. Scripting | 6 | 09 February 2013 16:51 |
AmigaDOS echo command speechmark | Retro1234 | support.Other | 3 | 01 May 2012 21:14 |
Would you cut into your A3000D case? | tonyyeb | support.Hardware | 57 | 19 September 2008 18:43 |
|
|