免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10775 | 回复: 9
打印 上一主题 下一主题

怎么用setenv [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-01-26 12:03 |只看该作者 |倒序浏览
为什么在命令行提示符可以用setenv
但写在C SHELL中就不能正常运行
也没有出错信息
用setenv查看环境变量,也没有设置好

#!/bin/csh -f
setenv ORACLE_BASE /home/oracle
setenv ORACLE_HOME $ORACLE_BASE

不知什么道理
请大家指教

论坛徽章:
0
2 [报告]
发表于 2005-01-26 14:45 |只看该作者

怎么用setenv

子shell的环境变量在脚本运行完就释放了啊
加到当前的环境下要用source方式执行才行
source yourfile

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
3 [报告]
发表于 2005-01-26 15:34 |只看该作者

怎么用setenv

原帖由 "大红机器" 发表:
子shell的环境变量在脚本运行完就释放了啊
加到当前的环境下要用source方式执行才行
source yourfile

同意机器的观点

论坛徽章:
0
4 [报告]
发表于 2005-01-26 15:39 |只看该作者

怎么用setenv

那怎么用SHELL永久设置呢?

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
5 [报告]
发表于 2005-01-26 15:58 |只看该作者

怎么用setenv

[quote]原帖由 "lee_scs"]那怎么用SHELL永久设置呢?[/quote 发表:

写在/etc/profile这样的文件中

论坛徽章:
0
6 [报告]
发表于 2005-01-26 16:49 |只看该作者

怎么用setenv

for C shell , usually the shell initialliation file could be .cshrc .

example in sun solaris system use C shell for oracle:
you might copy a sample cshrc file to your home directory .
#cp /etc/skel/local.cshrc /export/home/oracle/.cshrc
you might also want to edit this file and put in whatever setting you want it to be initialized for this user like
" setenv ORACLE_HOME /oracle/app/oracle/.....etc,etc  "

论坛徽章:
0
7 [报告]
发表于 2005-01-26 17:33 |只看该作者

怎么用setenv

不好意思,连FOREACH都不能运行

不知道是否是配置有问题

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
8 [报告]
发表于 2005-01-26 17:40 |只看该作者

怎么用setenv

看看tcsh方面的教材!
http://blog.chinaunix.net/index.php?op=ViewArticle&articleId=608&blogId=126

论坛徽章:
0
9 [报告]
发表于 2005-01-26 17:54 |只看该作者

怎么用setenv

your question make thing confused . exactly which part is not working ? could you paste your command together with ur detail error msg ?

论坛徽章:
0
10 [报告]
发表于 2013-08-09 10:57 |只看该作者
大红机器答得很好!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP