[Coco] stupid question, but the manual doesn't say

Wayne Campbell asa.rand at gmail.com
Sat Apr 19 11:39:11 EDT 2014


Hi Robert,

I used the scripts for building boot disks as a guide. The OS9 manual does
not cover script variables. I left out the prompt because I already know
what I am passing. This script is for deleting the files generated by
decode as I test. Using different modules to test with, I end up having to
type a long del command to delete them. I wrote the script to make it
easier. I type delf and they all go away. That works fine if you use the
same module over and over for testing, but when you use more than one, you
end up with different del commands. This script makes it easier. I just
type delf, then the name of the module I tested with, and all the files are
deleted. I may add this to the decode collection, as some may want to have
it handy. For that I will add a prompt so the user knows what they are
using it for.

Wayne



On Fri, Apr 18, 2014 at 7:14 PM, Robert Gault <robert.gault at att.net> wrote:

> Wayne Campbell wrote:
>
>> I have a shell script that I want to pass a value to. If I type the
>> script-file name and press enter, then enter the value I want, everything
>> is good, but if I type the script-file name with the value as a parameter,
>> I get a bad pathname error (215). To recap:
>>
>> OS9:script-file
>> value
>>
>> works.
>>
>> OS9:script-file value
>>
>> bad pathname
>>
>> What is the correct form? Below is my script-file.
>>
>> var.1
>> del %1Raw.txt
>> del %1Lines.txt
>> del %1Vars.txt
>> del %1VDT.txt
>> del %1DSAT.txt
>> del %1.B09
>>
>> Wayne
>>
>>
> I've not done any testing with the above but the script does not look
> quite right.
>
> Suppose that Value is the name of a file, as that seems the only thing
> that would make sense, and that value was FileName. Now suppose the script
> becomes
> del FileNameRaw.txt
> del FileNameLines.txt
> ...
> del FileName.B09
> The only line that immediately seems legal is the last one.
>
> In any case, when I have created scripts that need input, I have a line
> with a prompt which asks for the input, waits for an entry with a CR, and
> assigns the entry to a variable.
> I've had to write my own prompt (the current one in NitrOS-9 won't work
> for my purpose) but I use mine as:
> prompt2 echo Ask some question? ;var.1
> Phrase the prompt so you will be sure of what a user will enter so that
> del %1Raw.txt
> is a legal OS-9 command.
>
> Robert
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>



-- 
The Structure of I-Code
http://www.cocopedia.com/wiki/index.php/The_Structure_of_I-Code

decode
http://cococoding.com/wayne/



More information about the Coco mailing list