命令行子shell 括号 ()

子shell 控制变量

ansible-direc:~ # (export hello=world;echo $hello)
world
ansible-direc:~ # echo $hello

ansible-direc:~ #

实例: 不用单独更改权限,局部变量生效创建ca证书的私钥

ansible-direc:/etc/pki/CA # (umask 077;openssl genrsa -out private/cakey.pem 2048)
Generating RSA private key, 2048 bit long modulus
.+++
.........................................................................+++
e is 65537 (0x10001)

posted @ 2016-02-29 22:03  众里寻,阑珊处  阅读(152)  评论(0编辑  收藏  举报
返回顶部