Using "call" CLI command to call functions

I have a script, myScript.ash, which contains the function function1().

This CLI documentation leads me to believe that I can call that function from the CLI:
Code:
call 	[numberx] filename | function [parameters] 	check/run script.

But how should that call be formatted? Neither "function1" nor "call function1", prefixed with the script name or not, with or without parentheses, works. I'm sure this is a simple command-formatting issue.

> function1
unable to invoke function1
> function1()
unable to invoke function1
> myScript.function1
unable to invoke myScript.function1
> myScript.function1()
unable to invoke myScript.function1()
> call function1
unable to invoke function1
> call function1()
unable to invoke function1
> call myScript.function1
unable to invoke myScript.function1
> call myScript.function1()
unable to invoke myScript.function1()
 

heeheehee

Developer
Staff member
IIRC, this is tied to functions in scripts in your current namespace.
> help namespace

namespace [filter] - list namespace scripts and the functions they define.
using filename - add ASH script to namespace.
Maybe somewhat unfortunately, in order to remove a script from the namespace, you'll have to manually set the preference commandLineNamespace.
 
Thanks, both of you. Can't beat an explanation of what I was doing wrong, followed by a suggestion of a better method. Much appreciated!
 
Top