t****b 发帖数: 3 | 1 What is the problem with this shell scrip? The file name is flush.
alias rm rm
rm -rf log
rm -rf *_log
source ~/.tcshrc
I got prompt
rm: alias not found
rm: alias not found
flush: source: not found |
c*****t 发帖数: 1879 | 2 I don't think aliases work in shell scripts.
【在 t****b 的大作中提到】 : What is the problem with this shell scrip? The file name is flush. : alias rm rm : rm -rf log : rm -rf *_log : source ~/.tcshrc : I got prompt : rm: alias not found : rm: alias not found : flush: source: not found
|
m*******m 发帖数: 182 | 3 I think thereis an infinte loop here with alias.
【在 c*****t 的大作中提到】 : I don't think aliases work in shell scripts.
|
c*****t 发帖数: 1879 | 4 no. I always use
alias ls ls -F
In that case, shell looks for the real executable.
【在 m*******m 的大作中提到】 : I think thereis an infinte loop here with alias.
|
t****b 发帖数: 3 | 5 It seems this script works well except I got prompts.
When I comment out the first line, I got prompt
rm: examine files in directory log (yes/no)?
【在 c*****t 的大作中提到】 : I don't think aliases work in shell scripts.
|
m*******m 发帖数: 182 | 6 What if you use /bin/rm instead of rm? There could be alias
of rm already.
【在 t****b 的大作中提到】 : It seems this script works well except I got prompts. : When I comment out the first line, I got prompt : rm: examine files in directory log (yes/no)?
|