DOS putting a scrpts argument in a requestedfile

This forum is for general developer support questions.
Post Reply
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

DOS putting a scrpts argument in a requestedfile

Post by JosDuchIt »

I don't see a direct DOS possibility to first get some argument & then put it in a file the user choses
I came up with

Code: Select all

KEY VAR/A
.BRA {
.KET }
 
RequestFile ram: TITLE "VARfileName" to t:.VAR_File

echo "{VAR}" >`type t:.VAR_File`


the file is created but gets no content.
whereas from the shell
echo "mycontent" >`type t:.VAR_File`
will work.

Solution?
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: DOS putting a scrpts argument in a requestedfile

Post by broadblues »

Code: Select all

.key VAR/A
.bra {
.ket }

set filename `requestfile`
echo "{VAR}" >"${filename}"
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: DOS putting a scrpts argument in a requestedfile

Post by JosDuchIt »

@broadblues
yes, of course,
thanks
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: DOS putting a scrpts argument in a requestedfile

Post by JosDuchIt »

@BroadBlues

I don't know if it is the heat ir, but after an initial test of the script that worked correctly ,

i used a more complex command line and got the error message "RequestFile not executable"
After that even from the shell you got
7.Stock:MultiViewer> RequestFile
RequestFile: file is not executable

and even after a SW reboot that remained the case
I gradually simplified to get to the original command, to no avail
I can input a filename string with requeststring, but lck viual feedback then.
Do you observe something similar?

Code: Select all

KEY VAR/A
.BRA {
.KET }



set filename `requeststring Title "chose name" Body "" DefString "t:Lists_I_URL/"`
;// set filename`RequestFile t:Lists_I_URL TITLE "Select Name under which image should be recognised " ` ;// requestFile becomes not executable
;//set filename`RequestFile DRAWER t:Lists_I_URL TITLE "Select Name under which image should be recognised " ` 
;// set filename`RequestFile DRAWER t:Lists_I_URL TITLE "Select Name " `  ;// requestFile becomes not executable
set filename`RequestFile  `  ;// requestFile still not executable
; //set filename `requestfile`
echo "{VAR}" >"${filename}"
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: DOS putting a scrpts argument in a requestedfile

Post by thomasrapp »

Enter

which requestfile

to check where it is loaded from.

Don't call your script requestfile.
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: DOS putting a scrpts argument in a requestedfile

Post by xenic »

@thomasrapp
I notice the " | " (bar character) in his commands. That character is described as relating to a pipe in some AmigaDOS documentation. Could his commands be "accidently" using a pipe with dangerous results? I have never found an example of using the "|" char so I could be wrong about this.
AmigaOne X1000 with 2GB memory - OS4.1 FE
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: DOS putting a scrpts argument in a requestedfile

Post by JosDuchIt »

@thomas
Some empty file RequestFile was created in my script's drawer.
Thanks for the suggestion
@Xenix the character is not a | but i majuscule Ilist, thanks for your examination
Post Reply