English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 07 June 2023, 18:17   #1
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
How to select a filename "$file.$$" from shell?

Found a file "$file.$$" in a directory I wanted to delete from Shell, but usual apostrophe ' to select wildcards literally doesn't work ('$file.'$'$)...

What should I type from shell to perform a simple "list $file.$$" or "del $file.$$"?
hexaae is offline  
Old 07 June 2023, 19:03   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
The simple list $file.$$ works for me.

Make sure that you don't have a variable called file set because $file will always be replaced by the variable contents.

Try

unset file
unsetenv file
list $file.$$

If everything else fails and you only want to get rid of the file, use true wildcards:

delete ?file.??
thomas is offline  
Old 09 June 2023, 16:04   #3
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
I don't have $file var set...
Mmmh... possibily a bug in SFS filesystem...? A simple:
Code:
Echo >SYS:$file.$$ Ciao
Delete SYS:$file.$$
... sometimes fails and sometimes not.
When it fails it just does nothing and the shell prompt goes to a new line like an empty RETURN stroke.

Anyway thanks for confirming it is NOT a special char ($) issue with the AmigaOS as I initially thought.

Last edited by hexaae; 09 June 2023 at 16:17.
hexaae is offline  
Old 10 June 2023, 00:22   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Do you wait some seconds between command launches?
daxb is offline  
Old 10 June 2023, 11:54   #5
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
Of course...

EDIT: ok, it seems a KingCON problem... it can List/Delete a SYS:$file without issues, but seems to forcibly expand (non-existent) var when using $file.$$ on a command line.

Last edited by hexaae; 10 June 2023 at 12:37.
hexaae is offline  
Old 10 June 2023, 12:47   #6
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
KingCON does not do that.

What happens if you enter echo $file ?

Use set echo on to see which command is executed after variable substitution.
thomas is offline  
Old 10 June 2023, 14:10   #7
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
Yeah... tested booting without SSeq, and just mounting KCON it doesn't happen so it must be something else... Moreover it fails (nothing happens) first time I use "delete SYS:$file.$$" also with VincEd console. If I try again the same command it works from now on... So strange.

Already snooped with SnoopDos and when it fails it actually expands $file as a var (non-existent)... Still have to understand why as I was able to reproduce it even from OS3.9 fresh install + KCON...

I have an OS3.9 BBag3 installation (with some customizations), and:
console.device 44.10 (12-Mar-2003)
shell 45.7 (13-Gen-2002)
hexaae is offline  
Old 10 June 2023, 14:31   #8
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
Installed http://m68k.aminet.net/package/util/boot/ShellUpdate by THOR, and when I try a delete nothing appears under SnoopDos (!!) and shell now simply says:
Code:
[3.Workbench:] del $file.$$ 
object name invalid
A funny and mysterious bug... it all depends on the final .$$ as far as I can see. A file SYS:$file is ok to list and delete.
I know <$$> in a script represents the CLI process number under AmigaDOS.

Last edited by hexaae; 10 June 2023 at 16:11.
hexaae is offline  
Old 11 June 2023, 19:19   #9
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,216
Quote:
Originally Posted by hexaae View Post
Installed http://m68k.aminet.net/package/util/boot/ShellUpdate by THOR, and when I try a delete nothing appears under SnoopDos (!!) and shell now simply says:
Code:
[3.Workbench:] del $file.$$ 
object name invalid
A funny and mysterious bug... it all depends on the final .$$ as far as I can see. A file SYS:$file is ok to list and delete.
I know <$$> in a script represents the CLI process number under AmigaDOS.

Note that $$ is an invalid variable name, thus the error. That should be consistent with the latest shell. If I recall correctly, you should be able to escape the $ as *$ if you really mean the literal $ sign.


Note that there is (unfortunately) another set of rules active for "Execute", where the $ sign has just another meaning (*sigh*). You can, however, change that at the top of the script. ".dol" was, if I recall correctly, the way how to change the sign for "Parameter substitution" (not shell variables).


Yes, that's a big pile of mess...
Thomas Richter is offline  
Old 15 June 2023, 14:35   #10
hexaae
Bug hunter
 
hexaae's Avatar
 
Join Date: Jul 2006
Location: Italy
Age: 48
Posts: 2,161
Thank you Thomas.
Indeed the *$$ does work (I only tried '$ for wildcards that didn't work):


Last edited by hexaae; 15 June 2023 at 14:40.
hexaae 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
Query about "all" wildcard in Shell Foebane support.Apps 6 05 January 2020 14:08
ClassicWB: How can I launch "GamesMenu" from Shell? Foebane support.Apps 21 26 October 2018 19:33
CD and HDD volumes: "Select Archive or Plain File" Foebane support.WinUAE 18 05 February 2017 19:19
"Don't select more than 8 diferent VGA modes" - Indi AGA TenLeftFingers support.Hardware 3 26 May 2016 04:18
Auto-position the "Select a floppy disk image file..." menu Maren request.UAE Wishlist 17 30 January 2010 15:44

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 07:23.

Top

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