cli invoction in an ASH script

macman104

Member
I can't seem to find the post or info about it, but I remember at one point, when Veracity was talking about typedefs, it was discussed of a way to switch the script over to temporarily CLI code. I can't remember the exact syntax, and my searchfu is failing me, so I'll post in hopes someone will be able to point it out to me. From what I remember, in some ASH script you could have something along the lines of
<cli>
cli command here
another cli command on another line just like a regular .txt cli script
more cli goodness
</cli>
Or something along those lines. Am I dreaming, or does someone remember what I'm going on about?
 

Veracity

Developer
Staff member
I didn't look for the post, but I looked at the code.

There are two things:

1) In a CLI script, you can do this:

PHP:
<inline-ash-script>
...ash commands...
</inline-ash-script>

2) In an ASH script, you can do this:

PHP:
cli_execute {
...cli commands...
}

So, it goes both ways.

Caveat: I haven't actually used either of these, but that's how the code tells me it works, so...
 

macman104

Member
[quote author=holatuwol link=topic=1246.msg5799#msg5799 date=1190559071]
Here's the post. (linky)
[/quote]Thank you! Man, I searched all over for that, but I think I had assumed Veracity had posted about it, so I think I was ignoring all posts by you. Also, I used the cli_execute {} and it worked perfectly!
 
Top