Detecting the output stream type of a shell script

前端 未结 4 1186
隐瞒了意图╮
隐瞒了意图╮ 2021-02-07 10:13

I\'m writing a shell script that uses ANSI color characters on the command line.

Example: example.sh

#!/bin/tcsh
printf \"\\033[31m Succ         


        
4条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 10:49

    As far as I know, there is no way to determine the final destination of the output of your shell script; the only thing you can do is provide a switch which allows for suppression of control characters in the output.

提交回复
热议问题