csh で次の bash 関数を使用できるように、csh エイリアスを作成しています。
function up( )
{
LIMIT=$1
P=$PWD
for ((i=1; i <= LIMIT; i++))
do
P=$P/..
done
cd $P
export MPWD=$P
}
(上記の bash 関数はhereから盗みました)
私はこれを書いた:
alias up 'set LIMIT=$1; set P=$PWD; set counter = LIMIT; while[counter!=0] set counter = counter-1; P=$P/.. ; end cd $P; setenv MPWD=$P'
ただし、次のエラーが発生します。
while[counter!=0]: No match.
P=/net/devstorage/home/rghosh/..: Command not found.
end: Too many arguments.
私のスクリプトは意図したとおりに機能しません。ここからcshを読んでいます。
私は csh の専門家ではありません。上に書いたのは私の最初の csh スクリプトです。私が間違っていることを教えてください。