やあ。
のような場合は、使用しているようだ
csh 家族とはどのようにコマンドを実行すると、テストの終了ステータスを知って希望
もし。ほとんどの人は、 csh 、家族のメンバーの欠陥のため、技術的な欠点とされていないスクリプトを実行してよいものとします。家族は、 Bourneシェルスクリプトを実行して、優れた考えられている。
ただし、使用する必要があります
csh 、 使用可能なコマンドの終了ステータスを取得する括弧:
コード:
#!/bin/csh
# @(#) s2 Demonstrate csh braces: run command, test exit status.
# Create a scratch file if one does not exist.
touch t1
echo
if ( { ls t1 } ) then
echo " command ls succeeded."
else
echo " command ls FAILED."
endif
# Remove file.
rm t1
echo
if ( { ls t1 } ) then
echo " command ls succeeded."
else
echo " command ls FAILED."
endif
exit $status