Suppressing echo inside scripts
c.
kingcrimson at tiscali.it
Wed Dec 5 07:05:32 CST 2007
On 05/dic/07, at 11:15, Gabriel Popescu wrote:
>
> Hi all.
>
> I'm an Octave beginner and I have an easy question:
> using Octave as a command interpreter, e.g. using "#!/usr/bin/
> octave" in a
> script,
> I get lot of echoes; each code line generates a terminal output.
>
> The statement
>
> octave:1>varname=1
>
> shows on screen
>
> varname = 1
> octave:2>
>
> Is possible to suppress such automatic echo, leaving only output
> generated
> by printf command (or similar commands)?
>
> Thanks,
> Gabriel
If you don't want to see the result of each command you have to
terminate the line with a ";"
to turn off the initial message printed by octave use the -q option
#!/usr/bin/octave -q
varname = 1;
printf ("the value of varname is: %g\n",varname)
c.
More information about the Help-octave
mailing list