0

I'm trying to suppress some of the output from octave as per this post: https://stackoverflow.com/a/8303754/1033422:

oldpager = PAGER('/dev/null');
oldpso = page_screen_output(1);
oldpoi = page_output_immediately(1);

... do some stuff

PAGER(oldpager);
page_screen_output(oldpso);
page_output_immediately(oldpoi);

However, when I run my script, octave is displaying the error:

sh: /dev/null: Permission denied

Update:

$ ls -l /dev/null
crw-rw-rw-  1 root  wheel    3,   2 24 Jan 19:07 /dev/null
Community
  • 1
  • 1
Chris Snow
  • 23,813
  • 35
  • 144
  • 309

1 Answers1

1

The issue is that PAGER is expecting a program (such as less) and /dev/null is not a program.

Query or set the internal variable that specifies the program to use to display terminal output on your system.

Instead, what you could do would be to set PAGER such that it uses less but then pipes the output directly to /dev/null

PAGER('less > /dev/null')
Suever
  • 64,497
  • 14
  • 82
  • 101