[Wien] WIEN2k_16

Elias Assmann elias.assmann at gmail.com
Wed Dec 21 11:41:23 CET 2016


On 12/21/2016 09:34 AM, Peter Blaha wrote:
> The strange symbols should not matter, but if you don't like them,
> either fix your Linux, or modify init_lapw setting   bold and normal
> 
> set bold=
> set normal=

FWIW, you can detect whether STDIN is a terminal using `tty':

$ tty             # returns 0
/dev/pts/6
$ tty </dev/null  # returns 1
not a tty

But there is a complication: what we really want to know is whether
STDOUT is a terminal, not STDIN.  In bash you would do `tty <&1' to test
that, but csh cannot do this, as far as I can tell.  You can use
/dev/stdout, but I think that is somewhat less portable.  That would
leave us with:

tty -s < /dev/stdout

if ( $status == 0 ) then
	set bold=`tput bold`
	set normal=`tput sgr0`
else
	set bold=
	set normal=
endif

(I am also not aware of a csh equivalent to `if COMMAND; then' without
resorting to $status.)


	Elias


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 880 bytes
Desc: OpenPGP digital signature
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20161221/f8ed0a8f/attachment.asc>


More information about the Wien mailing list