export: command not found

linux下非root执行export命令出现 export: command not found 错误
[root@mysqlserver bin]# csh
[root@mysqlserver /bin]# export
export: Command not found.
[root@mysqlserver /bin]#

export是shell的内部命令,寻找规则与PATH变量无关。
重点检测SHELL变量是不是bash,如下
查看SHELL变量, echo $SHELL
[root@mysqlserver bin]# echo $SHELL
/bin/bash
[root@mysqlserver bin]#

如果是 
/bin/csh

那么执行bash命令启动bash,或者在对应的脚本前执行bash命令。 

[root@mysqlserver bin]# bash
[root@mysqlserver bin]# export AAA=nn
[root@mysqlserver bin]#

具体指定用户的shell环境的配置文件在/etc/passwd 中
[root@mysqlserver bin]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
~~~~

修改对应的shell配置即可。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30246290/viewspace-1976507/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30246290/viewspace-1976507/

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值