未找到linux问题setenv命令(linux issue setenv command not found)
我在Linux中开发了一个Tcl / Tk脚本工具。 为了运行该工具,每次需要在shell中设置这样的环境变量时:
setenv LD_LIBRARY_PATH /opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
然后使用“希望”解释器启动我的工具:
/abc/software/new2015/GE/tcl_tk/bin/wish mytool.tk
为了使它容易使用,我想要设计一个shell脚本“abc_wish”并将上面的命令放在里面:
#!/bin/sh
setenv LD_LIBRARY_PATH /opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
wish="/abc/software/new2015/GE/tcl_tk/bin/wish"
exec $wish $@
然后我需要运行:
./abc_wish mytool.tk
但错误信息显示setenv命令没有找到!我对这些系统问题完全陌生,需要一些关于这些东西的帮助。 希望我已经清楚地表明了这个问题。
I develop a Tcl/Tk script tool in Linux. In order to run the tool, every time I need to set the environment variable like this in shell:
setenv LD_LIBRARY_PATH /opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
and then use "wish" interpreter to launch my tool:
/abc/software/new2015/GE/tcl_tk/bin/wish mytool.tk
To make it a little easy to use, I want design a shell script "abc_wish" and put the above command inside:
#!/bin/sh
setenv LD_LIBRARY_PATH /opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
wish="/abc/software/new2015/GE/tcl_tk/bin/wish"
exec $wish $@
And then I need just run:
./abc_wish mytool.tk
But error message shows that setenv command not found!I am totally new to such system issues, need some help about these stuffs. Hope I have shown the issue clearly.
原文:https://stackoverflow.com/questions/27737224
更新时间:2020-01-14 08:15
最满意答案
setenv是一个csh命令,而不是sh命令。 bash的等价物是export :
#!/bin/sh
export LD_LIBRARY_PATH=/opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
exec wish "$@"
您还应该在报价中加入$@ ,以确保正确地重新引用扩展。
setenv is a csh command, not a sh command. The equivalent in bash is export:
#!/bin/sh
export LD_LIBRARY_PATH=/opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
exec wish "$@"
You should also put $@ in quote, to ensure proper re-quoting of the expansion.
2015-01-02
相关问答
ls:列目录。 用法:ls或ls dirName,参数:-a显示所有文件,-l详悉列出文件。 mkdir:建目录。 用法:mkdir dirName,参数:-p建多级目录,如:mkdir a/b/c/d/e/f -p mount:挂载分区或镜像文件(.iso,.img)文件。 用法: a.磁盘分区:mount deviceName mountPoint -o options,其中deviceName是磁盘分区的设备名,比如/dev/hda1,/dev/cdrom,/dev/fd0,mountPoi
...
[ putenv(char *string); [...]电话似乎有致命的缺陷。 是的,这是致命的缺陷。 它被保存在POSIX(1988)中,因为这是现有技术。 setenv()机制稍后到达。 更正: POSIX 1990标准在§B.4.6.1中说明“附加函数putenv ()和clearenv()被考虑但被拒绝”。 从1997年开始的单一Unix规范 (SUS)版本2列出了putenv()但不是setenv()或unsetenv() 。 下一次修订(2004年)确实同时定义了setenv()和u
...
按变量的生存周期来划分,Linux变量可分为两类,它们的修改方法如下: (1)永久的:需要修改配置文件,变量永久生效。 常见的配置文件包括: (1-1)/etc/profile:对所有用户生效;此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行;并从/etc/profile.d目录的配置文件中搜集shell的设置 例如:编辑/etc/profile文件,添加CLASSPATH变量 # vi /etc/profile 添加一行: export CLASSPATH=./JAVA_HO
...
我可以通过launchctl中添加launchctl来解决它: do shell script "launchctl setenv VAR value"
我也遇到了在同一个脚本中使用nohup的问题,而不得不使用完整路径/usr/bin/nohup 。 I could solve it by adding launchctl to the line: do shell script "launchctl setenv VAR value"
I also had the problem usin
...
SetEnv是一个Apache指令 ; 它进入.htaccess文件或服务器配置文件,而不是php.ini。 SetEnv is an Apache directive; it goes in a .htaccess file or your server config files, not in php.ini.
setenv是一个csh命令,而不是sh命令。 bash的等价物是export : #!/bin/sh
export LD_LIBRARY_PATH=/opt/lsf/9.1/linux2.6-glibc2.3-x86_64/lib:/abc/software/new_2015/GE/tcl_tk/lib64:/abc/software/new_2015/GE/tcl_tk/lib64
exec wish "$@"
您还应该在报价中加入$@ ,以确保正确地重新引用扩展。 setenv is a
...
感谢@shelter和@gbulmer的帮助。 我真的很讨厌回答我自己的问题,但这可能有助于将来的某个人...... 最后,我更新了我的C Shell脚本,以便在多个单独的行上设置变量: set gkd = `gnome-keyring-daemon`
set pid = `echo $gkd | sed 's/.*GNOME_KEYRING_PID=\([0-9]\+\)/\1/'`
set socket = `echo $gkd | sed 's/GNOME_KEYRING_SOCKET=
...
使用/ bin / mkdir作为它的地方...我不知道你的$ PATH包含所以这就是我的'简单修复' use /bin/mkdir as thats where it is ... i dont know your $PATH contains so thats my 'easy fix'
就ns1:和esc:而言,没有问题。 ns1:和esc:是名称空间的前缀。 在根元素中,您为给定的命名空间指定前缀,稍后在元素中通过指定的前缀引用属于该命名空间的元素。 例如,在您的服务器预期调用根元素中,命名空间http://escoles.webservice.jovtitus.dasc.gencat.net被赋予前缀esc。 所以元素esc:login被解析为在该命名空间中。 在PHP生成的调用中,名称空间http://escoles.webservice.jovtitus.dasc.gen
...
使用反引号而不是引号: setenv JAVA_HOME `pwd`
Use backticks instead of quotes: setenv JAVA_HOME `pwd`