Page 1 of 1

DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 6:12 am
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?

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 10:34 am
by broadblues

Code: Select all

.key VAR/A
.bra {
.ket }

set filename `requestfile`
echo "{VAR}" >"${filename}"

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 11:53 am
by JosDuchIt
@broadblues
yes, of course,
thanks

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 4:45 pm
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}"

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 4:53 pm
by thomasrapp
Enter

which requestfile

to check where it is loaded from.

Don't call your script requestfile.

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 6:49 pm
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.

Re: DOS putting a scrpts argument in a requestedfile

Posted: Sat Jul 04, 2015 7:59 pm
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