English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 04 January 2020, 20:08   #1
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 47
Posts: 1,922
Query about "all" wildcard in Shell

This is more of a curiosity, so bear with me:

I've just successfully used the command

Code:
copy all from rdh0: to sys:games/s
for a game to copy it from a removable drive to a specified path. The "all" keyword is useful as it allows for the copying of everything in that path, both files and folders... but then I got to thinking, what if there is a file there called "all" in the source path? Will it copy everything, or just that file?

Just curious as to how Shell would manage that.
Foebane is offline  
Old 04 January 2020, 20:41   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,488
Here it works. You can try it on your system. However, FROM and TO aren't needed and ALL can be placed at the end. E.g.: "copy rdh0: sys:games/s ALL CLONE". Don't to forget to use CLONE.
daxb is offline  
Old 04 January 2020, 23:58   #3
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,934
Quote:
Originally Posted by Foebane View Post
but then I got to thinking, what if there is a file there called "all" in the source path?
The arguments are examined first. If ALL is found in the command line, it is used as switch, not as file name. If you want to copy a file called "all", you have to put it in quotes or put the keyword from in front of it.

copy "all" dh0: all
copy from all to dh0: all
copy from="all" dh0: all
copy all from all to dh0:

this might work, but i'm not sure: copy all all dh0:

This one, if it passes the argument examination, will not do what you might think it does: copy all dh0: all
It will copy all files and drawers from dh0 to a new directory called "all".
thomas is offline  
Old 05 January 2020, 01:30   #4
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 47
Posts: 1,922
Quote:
Originally Posted by daxb View Post
Here it works. You can try it on your system. However, FROM and TO aren't needed and ALL can be placed at the end. E.g.: "copy rdh0: sys:games/s ALL CLONE". Don't to forget to use CLONE.
It worked great! Thanks!

Quote:
Originally Posted by thomas View Post
The arguments are examined first. If ALL is found in the command line, it is used as switch, not as file name. If you want to copy a file called "all", you have to put it in quotes or put the keyword from in front of it.

copy "all" dh0: all
copy from all to dh0: all
copy from="all" dh0: all
copy all from all to dh0:

this might work, but i'm not sure: copy all all dh0:

This one, if it passes the argument examination, will not do what you might think it does: copy all dh0: all
It will copy all files and drawers from dh0 to a new directory called "all".
Sounds complicated. To think that the designers of AmigaOS, WB and Intuition had so little time to develop a full-blown OS without the resources of Microsoft or anything like that, it's amazing.
Foebane is offline  
Old 05 January 2020, 10:31   #5
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 342
Quote:
Originally Posted by Foebane View Post
Sounds complicated. To think that the designers of AmigaOS, WB and Intuition had so little time to develop a full-blown OS without the resources of Microsoft or anything like that, it's amazing.
I'm sorry to disappoint you, but this stuff was not designed by CBM engineers at all. It was bought, as complete product, from MetaComCo, UK, who bought TRIPOS from the University of Cambridge. All of this stuff - the dos.library, the shell and its commands - are older than AmigaOs.
Thomas Richter is offline  
Old 05 January 2020, 10:50   #6
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 47
Posts: 1,922
Quote:
Originally Posted by Thomas Richter View Post
I'm sorry to disappoint you, but this stuff was not designed by CBM engineers at all. It was bought, as complete product, from MetaComCo, UK, who bought TRIPOS from the University of Cambridge. All of this stuff - the dos.library, the shell and its commands - are older than AmigaOs.
I've heard of MetaComCo before, but I didn't know it was British! WOW! Talk about NON-disappointment!
Foebane is offline  
Old 05 January 2020, 14:08   #7
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,934
Quote:
Originally Posted by Foebane View Post
Sounds complicated.

Actually it is not complicated at all. If you enter copy ? it will display the command line template. This template is used to read the command line arguments. This is done by the ReadArgs function independently of the purpose of the command. This means at this stage it does not yet look into the file system and this it does not matter whether a file named ALL is there or not.

The template contains four parameters: FROM, TO, ALL and CLONE. The ReadArgs function parses the command line and fills in these four parameters. If the word ALL is found, the ALL switch will be set on. If the word CLONE is found, the CLONE switch will be set on. If the word FROM is found, the string behind it will be put into the FROM parameter. If the word TO is found, the string behind it will be put into the TO parameter. If neither FROM or TO are found but there are unnamed arguments, the first one will be put into FROM and the last one into TO.

When the ReadArgs function returns, the Copy command will continue with the parameter list returned. It does not look into the command line any more. It uses the switches and strings returned by the ReadArgs function in the parameter list.

So in order to copy the ALL file, you have to think how to tell ReadArgs that the string ALL should go into the FROM place of the parameter list.

Code:
copy from all dh0:
should do it. The "all" string will go into the FROM place because it is preceded by the "from" keyword. "dh0:" will go into the TO place because it is unnamed and FROM is already set.
thomas 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
"Diabolik" & "Dylan Dog" & "Tex" & "Time Runners" series DamienD request.Old Rare Games 14 07 February 2020 16:34
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" DemosongIHunter request.Music 44 27 October 2019 19:04
ClassicWB: How can I launch "GamesMenu" from Shell? Foebane support.Apps 21 26 October 2018 19:33
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 00:06
HOL "Query failed" - broken link A500-Danny HOL suggestions and feedback 2 27 July 2007 21:27

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


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