Redian新闻
>
"#! /bin/csh" != "#!/bin/csh" ??????
avatar
"#! /bin/csh" != "#!/bin/csh" ??????# Unix - 噫吁兮,危乎高哉
u*n
1
When I use a software to process my data, I find there is
one shell script file doesn't work for my machine ( SunOS 5.7).
I check this file, and find the top of this file is
"#! /bin/csh"
When I delete the "blank" between "!" and "/bin/csh", i.e., change this
line as
"#!/bin/csh"
It works !!!
Since, in this file, there are lots of awk commond. I guess "#! /bin/csh"
will lead to "/bin/sh" to run this file, and hence lead to my awk problem.
So, is my idea correct ? I am not sure. After all, I am a
avatar
c*t
2

You may run '/bin/csh yourscriptfile', then a new child csh will be created.
I think 'awk' also works in sh or ksh. You can run 'echo $RAMDOM' to figure
out what the default shell is. ( Return something, ksh; empty BourneShell;
error prompt, csh) or 'grep blah /etc/passwd' to do the same job.

【在 u*******n 的大作中提到】
: When I use a software to process my data, I find there is
: one shell script file doesn't work for my machine ( SunOS 5.7).
: I check this file, and find the top of this file is
: "#! /bin/csh"
: When I delete the "blank" between "!" and "/bin/csh", i.e., change this
: line as
: "#!/bin/csh"
: It works !!!
: Since, in this file, there are lots of awk commond. I guess "#! /bin/csh"
: will lead to "/bin/sh" to run this file, and hence lead to my awk problem.

avatar
u*n
3

Thanks at first.
However, it seems that RAMDOM is an Undefined variable.
As to "/etc/passwd", that file is shadowed.
As I remember, there is a commond can show the password file. Who knows ?

【在 c**t 的大作中提到】
:
: You may run '/bin/csh yourscriptfile', then a new child csh will be created.
: I think 'awk' also works in sh or ksh. You can run 'echo $RAMDOM' to figure
: out what the default shell is. ( Return something, ksh; empty BourneShell;
: error prompt, csh) or 'grep blah /etc/passwd' to do the same job.

avatar
c*t
4

It seems that the default shell is (t)csh. 'echo $SHELL' to verify.

【在 u*******n 的大作中提到】
:
: Thanks at first.
: However, it seems that RAMDOM is an Undefined variable.
: As to "/etc/passwd", that file is shadowed.
: As I remember, there is a commond can show the password file. Who knows ?

avatar
u*n
5

It shows " /bin/csh". I guess the problem in that codes is caused by a
unseen symbol.
Thanks, buddy
-
-

【在 c**t 的大作中提到】
:
: It seems that the default shell is (t)csh. 'echo $SHELL' to verify.

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