avatar
生成script文件的问题# Unix - 噫吁兮,危乎高哉
F*Q
1
我想生成一个最简单的script文件,就是改变一下当前目录,比如
nedit tome
然后键入
#!/bin/tcsh
cd /afs/thayer/nmlhome/fangq
然后保存文件,
chmod +x tome
然后执行的时候什么都不显示,也没有改变目录,
另外一个最简单的;例子:
#!bin/tcsh
echo $1
执行的时候也没有显示第一个参数,什么反应也没有,请问是什么原因?
俺是在aix的tcsh下
avatar
m*e
2
It changes the dir in the script; but it doesn't affect your current shell.
You can do:
. your_script
This will execute the script inside current shell.

【在 F***Q 的大作中提到】
: 我想生成一个最简单的script文件,就是改变一下当前目录,比如
: nedit tome
: 然后键入
: #!/bin/tcsh
: cd /afs/thayer/nmlhome/fangq
: 然后保存文件,
: chmod +x tome
: 然后执行的时候什么都不显示,也没有改变目录,
: 另外一个最简单的;例子:
: #!bin/tcsh

avatar
F*Q
3
加.是不是source?
能不能不用source呢?

【在 m*****e 的大作中提到】
: It changes the dir in the script; but it doesn't affect your current shell.
: You can do:
: . your_script
: This will execute the script inside current shell.

avatar
m*e
4

yes
alias your_script='. your_script'
No other way as I know of.

【在 F***Q 的大作中提到】
: 加.是不是source?
: 能不能不用source呢?

avatar
F*Q
5
thanks!

【在 m*****e 的大作中提到】
:
: yes
: alias your_script='. your_script'
: No other way as I know of.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。