26 October 2023, 16:08 | #1 |
Retro Freak
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,647
|
AmigaDOS problems with scripting and double quotes
Hi
We are trying to do a whdload launcher that would use a database to get all the options and then execute a script that in the end actually launches WHDLoad. The script is used so that people can customize it as they want. However we have problem with parsing the double quotes " inside the script. On OS 3.2 it seems to be working fine when we use the substituon (escaping) of " with *" , example (ECHO "$TT" is the correct usage) : But when the same code is run on 3.1 we get this: And no usage will work. Is there any way to use this on OS 3.1 in scripting ? btw. the actual line CONFIG="aaa;ccc" nocache is passed over to the script using a WHDARGS parameter which is gotten with this key: .key FOLDER,SLAVE/A,WNC/S,WEC/S,NOTURBO/S,NFC/S,SC/S,ICNT/N,MHZ/N,WHD/K,WHDARGS/F |
26 October 2023, 16:37 | #2 |
Registered User
Join Date: Jan 2005
Location: UmeƄ
Age: 43
Posts: 924
|
Out of curiosity, is the content of the TT env identical in 3.2 and 3.1? You should be able to view it with the GetEnv command.
|
26 October 2023, 16:38 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,001
|
Interesting. I first tried with "aaa;ccc" only. Then the result is the other way round, with quotes I got the full string, without it was truncated at the ;
Anyway, this seems to be a bug of the Echo command. Use getenv instead. And BTW, for simple variables you should use set/get instead of setenv/getenv. SetEnv is only useful to save global settings. Or if there is no other possibility than to write to a variable with >env:xxx |
26 October 2023, 17:02 | #4 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,180
|
never actually tried before but can amigaos use single quotes in place of doubles like you can in linux scripts where you are able to mix/match them?
|
26 October 2023, 17:04 | #5 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
In shells commonly used on Linux, single and double quotes mean different things, so you can't actually mix and match them.
|
26 October 2023, 17:08 | #6 |
Retro Freak
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,647
|
|
26 October 2023, 17:15 | #7 | |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,180
|
Quote:
Code:
# No PATH Found, add PATH to .bashrc echo 'if [ -d "$HOME/.local/bin" ] ; then' >> $HOME/.bashrc echo 'PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc echo 'fi' >> $HOME/.bashrc echo "PATH was not set to check $HOME/.local/bin for scripts/commands, this has been corrected." echo "** You need to close this terminal window and re-open for changes to take effect **" exit |
|
26 October 2023, 17:17 | #8 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,180
|
does the CONFIG= actually need quotes at all? is this specifically for catching spaces?
Also are you trying to get your script to launch WHDLoad and the options normally found in the icon tooltypes? can you not use something like WBRUN to launch the slaves icon which has the options/config for that game and even launches WHDLoad from the project icon? |
26 October 2023, 19:24 | #9 | |
Retro Freak
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,647
|
Quote:
Thanx everyone! |
|
26 October 2023, 19:24 | #10 | |
Retro Freak
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,647
|
Quote:
WBRun doesn't come into play because the script is used by the wrapper which must work with both CLI and ICON start... |
|
26 October 2023, 22:31 | #11 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,233
|
Quote:
The "echo" command does surprisingly little. This sounds more like a defect (one of many) of the 3.1 shell. What likely happens is that the shell blindly expands the variable, removes the quotes and then puts the result into the shell parser. The ";" in the middle of the string is then read by the remaining shell parser as introduction of a comment, and stripped off. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AmigaDOS scripting resources | Photon | Coders. System | 26 | 19 March 2018 14:51 |
Amiga Game Speeches and Quotes. | cebulba | Nostalgia & memories | 22 | 06 March 2016 17:31 |
AmigaDOS 1.3 Scripting Language | redblade | Coders. General | 10 | 16 August 2008 12:58 |
Team 17 CD32 Double Pack problems! | Mrk | support.WinUAE | 4 | 12 March 2007 18:42 |
Crazy Wacky Non Understandable game quotes | Fred the Fop | Nostalgia & memories | 5 | 23 February 2004 11:02 |
|
|