由买买提看人间百态

topics

全部话题 - 话题: prsth
(共0页)
r********s
发帖数: 179
1
[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
r********s
发帖数: 179
2
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?
(共0页)