for example, alias t `cat /bbs/boards/family/6666 写个script把alias t放进去怎么不工作呢? 说没有这个命令。
o*z
2 楼
不放在script里能工作吗?
【在 t*******l 的大作中提到】 : for example, : alias t `cat /bbs/boards/family/6666 : 写个script把alias t放进去怎么不工作呢? : 说没有这个命令。
t*l
3 楼
能。
【在 o***z 的大作中提到】 : 不放在script里能工作吗?
c*y
4 楼
source le 没?
【在 t*******l 的大作中提到】 : for example, : alias t `cat /bbs/boards/family/6666 : 写个script把alias t放进去怎么不工作呢? : 说没有这个命令。
t*l
5 楼
source .cshrc?
【在 c********y 的大作中提到】 : source le 没?
o*z
6 楼
t后面的最好用''括起来 try this in your tc壳: echo "alias t 'cat /bbs/boards/family/6666'" > ttt source ./ttt t
【在 t*******l 的大作中提到】 : for example, : alias t `cat /bbs/boards/family/6666 : 写个script把alias t放进去怎么不工作呢? : 说没有这个命令。
r*s
7 楼
Let's do a test in explicit shell definition. [12:04am] tail -n 1 ~/.cshrc alias prsth 'echo "It Works"' [12:04am] cat xixi.csh #!/bin/csh prsth [12:04am] ./xixi.csh It Works [12:04am] cat xixi.sh #!/bin/sh prsth [12:04am] ./xixi.sh ./xixi.sh: prsth: not found Isn't it clear now?
【在 t*******l 的大作中提到】 : for example, : alias t `cat /bbs/boards/family/6666 : 写个script把alias t放进去怎么不工作呢? : 说没有这个命令。
t*l
8 楼
最后一句看懂了。。。。 你的command提示伏太长了点。。。 hehe~! thanks.
【在 r********s 的大作中提到】 : Let's do a test in explicit shell definition. : [12:04am] tail -n 1 ~/.cshrc : alias prsth 'echo "It Works"' : [12:04am] cat xixi.csh : #!/bin/csh : prsth : [12:04am] ./xixi.csh : It Works : [12:04am] cat xixi.sh : #!/bin/sh
t*l
9 楼
thanks.I will try this and come back to you if anything wrong.:P
【在 o***z 的大作中提到】 : : t后面的最好用''括起来 : try this in your tc壳: : echo "alias t 'cat /bbs/boards/family/6666'" > ttt : source ./ttt : t
D*e
10 楼
i told him sh doesn't have alias.
【在 r********s 的大作中提到】 : Let's do a test in explicit shell definition. : [12:04am] tail -n 1 ~/.cshrc : alias prsth 'echo "It Works"' : [12:04am] cat xixi.csh : #!/bin/csh : prsth : [12:04am] ./xixi.csh : It Works : [12:04am] cat xixi.sh : #!/bin/sh
r*s
11 楼
[6:19pm] echo $SHELL /bin/tcsh [6:20pm] alias prsth 'echo "It Works"' [6:20pm] cat > xixi.csh #!/bin/csh prsth [6:21pm] chmod +x xixi.csh [6:21pm] ./xixi.csh prsth: Command not found. [6:21pm] cat > xixi.csh #!/bin/csh alias prsth 'echo "It Works"' prsth [6:28pm] ./xixi.csh It Works ********** From the above test, we can see this might be the case touchsoul got stuck in. i.e., even when you are using csh/tcsh, yo
【在 D**e 的大作中提到】 : i told him sh doesn't have alias.
t*l
12 楼
I put my alias in .cshrc, and write it in my script. alias read '/bbs/boards/family/display_posts alias dead 'read last_post' ------------this doesn't work both don't work in my script.
【在 t*******l 的大作中提到】 : I put my alias in .cshrc, and write it in my script. : alias read '/bbs/boards/family/display_posts : alias dead 'read last_post' ------------this doesn't work : both don't work in my script.
find a local unix expert to help you out. sometimes it's just not easy to find the trick. several months ago, I started to use digital unix and found a strange thing I have never encountered. vi refused to read its resource file, ".exrc". I asked my colleagues and didn't get a clue. then I "man vi". The following messages suddenly shed a light on my puzzle. [Tru64 UNIX] Additionally, the editor refuses to read the .exrc file if its mode grants write permission to anyone other than the owner
hahahaha. still not working? is your hair white now? i remember the other time i was debugging a program. it just refused to work. eventually i noticed i was modifying one copy of the source and compiling another copy. stupid me.
【在 o***z 的大作中提到】 : pick up a book and do some reading
r*s
20 楼
,苏倍庆著,学苑出版社。台湾人写的,深入浅出。
【在 t*******l 的大作中提到】 : 手头没什么书了, : 需要买.推荐一本吧
t*l
21 楼
有电子版可以下吗?
c*e
22 楼
alias 只能在当前 shell 工作。而你的script运行在子 shell 里。所以不工作
work in. .cshrc
【在 t*******l 的大作中提到】 : I put my alias in .cshrc, and write it in my script. : alias read '/bbs/boards/family/display_posts : alias dead 'read last_post' ------------this doesn't work : both don't work in my script.