Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Orphan264 on January 28, 2020, 02:11:15 PM
-
Looking for assistance with a script - I want to create a drawer named from the date. I am using OS 3.1.4.1
For example - today is January 28, 2020. I want the script to create a drawer named for the ANSI date such as
2020-01-28
Where do I begin? I appreciate the help.
-
Either you make a little script that takes an argument or something like this.
c:makedir `c:date`
Dunno if this works everytime.
-
Thanks, I will try that and see what I have.
-
Yeah, dream on :)
You wish to format the output of C:Date, but VERY SADLY, C:Date does not support that, so you have to jump through hoops around the problem.
Echo to T:timestamp
Makedir `List DATES T:timestamp LFORMAT %D`
Delete T:timestamp QUIET
This creates a temporary file, which you then can list with LDORMAT %D to get the date from, but you need "DATES" parameter or it will always say "Today", and then make a directory with this name - also SADLY it will be 29-Jan-20 and not 29-01-2020, and there is little you can do about that, and also this output depends on locale, so in case of the month of May, a system with English locale will for example say "29-May-20", while with Norwegian locales will say "29-Mai-20" and Swedish "29-Maj-20" etc.
If you think that this is all crazy and should be corrected, you can join my whining choir...
-
With OS4, you can do
makedir `date lformat %Y-%m-%d`
Not sure if your version of C:Date has the LFORMAT argument.
Edit: Seems not, according to Kolla's post above. Sorry.
Best regards,
Niels
-
Shouldn't be that hard to find another date alike tool that just outputs the date without locale messing it up.
http://aminet.net/package/util/cli/fdate
-
Or, use this one.
It is a quick&dirty example.
For sorting purposes you might want to use option 'a', which fits best.
Unfortunately, AMIGA forum does not allow LHA attachments.
-
Huh, why resort to third party software - even though AmigaDOS date is tedious in all kinds of ways, ARexx DATE works fine, for example
Makedir `rx “SAY DATE(S)”`
may be good enough, it makes a 20200201 directory today.
-
A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)
-
A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)
The problem is that over time, your path fills up with a range of third party tools that you no longer have any idea where they came from or what they really do :) ARexx you can count on being there, and it's in general a better choice for scripting.
Btw - if anyone feel like reporting an OS bug... well, ARexx bug - DATE(CENTURY) is supposed to return the number of days in this century, but it really looks more like the number of days since 01-01-1900, and not since 01-01-2000. So it's really a "Y2K" bug.
-
I used to add several 'c' directories onto my system drive which are late-assigned to C: during startup.
This way i have a rather small C: (or sys:C/) but all my (de)crunchers are in sys:c3/, my own tools are in sys:c_plus/ and so on but they are still reachable from the path.
A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)
The problem is that over time, your path fills up with a range of third party tools that you no longer have any idea where they came from or what they really do :)
-
I used to add several 'c' directories onto my system drive which are late-assigned to C: during startup.
This way i have a rather small C: (or sys:C/) but all my (de)crunchers are in sys:c3/, my own tools are in sys:c_plus/ and so on but they are still reachable from the path.
I once did that too. One downside of that is that when you install updates to the system components, or vice versa to the third party tools, you may be surprised by where they end up. In practice, I would end up installing everything by hand, even when it had installation scripts.
Best regards,
Niels
-
In practice, I would end up installing everything by hand, even when it had installation scripts.
Niels
Sure, but isn't that the fun of being able to do just that on Amiga? ;D
-
In practice, I would end up installing everything by hand, even when it had installation scripts.
Sure, but isn't that the fun of being able to do just that on Amiga? ;D
Not in cases where you are trying to test the software, including its installation script.
Best regards,
Niels
-
Or, use this one.
It is a quick&dirty example.
For sorting purposes you might want to use option 'a', which fits best.
I want to thank you for going through the trouble of providing the example script! I really appreciate it!
-
My pleasure. I had to test it myself, aint i? :D