command line option

gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

command line option

Post by gaurav.shetti »

How can i run command line commands from vortex.
for eg take tail -f directorypath gives errors of vortex when run from texis.
How can i run it directly from vortex web server.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

command line option

Post by mark »

gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

command line option

Post by gaurav.shetti »

In texis ... we can run something like this
-bash-3.00$ tail -f /usr/local/morph3/texis/vortex.log

The above command lists all the errors recently logged by the voretx script. This command is run at texis level.

I want to call this command inside the vortex script.
<a name=main>

Call it here

</a>

What is the syntax for calling the tail command from vortex file.
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

command line option

Post by John »

You can use the <exec> command to execute a command line program. Note the -f option to tail is probably not useful as if causes tail to not finish. You might also want to look at the <readln> function with the REV option to read lines from the end of the file.
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

command line option

Post by mark »

If you're wanting to process the lines from the file as they come in you'll need to use <readln> and/or pipe tail -f into the script instead execing within as the exec will wait for the command to finish and return all the output at once.

tail -f .../vortex.log|texis myscript
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

command line option

Post by gaurav.shetti »

Mark, can you provide an example.
Thanks
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

command line option

Post by mark »

An example of what? I provided an example of piping tail into vortex.

What's the overall task you're trying to accomplish? That might better help us understand the problem and how to solve it.