Chinaunix

标题: 怎样修改自带命令的默认项 [打印本页]

作者: t069064449    时间: 2017-08-19 10:10
标题: 怎样修改自带命令的默认项
比如我的linux下echo命令的-e和-E参数,默认是-E的,怎样修改成-e的?
现在我打echo 'abc\c'会直接出来abc\c
必须手动加echo -e 'abc\c'才行

附:
man echo
ECHO(1)                          User Commands                         ECHO(1)

NAME
       echo - display a line of text

SYNOPSIS
       echo [OPTION]... [STRING]...

DESCRIPTION
       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)


作者: yyu0378    时间: 2017-08-21 00:57
alias就可以了

作者: cu_shell    时间: 2017-08-22 14:54
同上,添加别名
  1. echo alias echo=\'echo -e\' >> .bashrc
  2. source .bashrc
复制代码

作者: t069064449    时间: 2017-09-18 08:55
对啊 我怎么没想到。。。谢谢大家




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2