Ticket #35910

If/while/until 空条件の解釈

Date d'ouverture: 2016-01-12 00:15 Dernière mise à jour: 2016-01-14 23:37

Rapporteur:
Propriétaire:
Type:
État:
Ouvert [Owner assigned]
Composant:
Jalon:
(Aucun)
Priorité:
3
Sévérité:
3
Résolution:
Aucun
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

If, while, until 文で条件コマンドがないとき、今は true と見做されるようになっている。しかし条件コマンド実行時に終了ステータスは変更されない。なので false; if then echo $?; fi は 1 を出力する。これは気色悪くないか?

  • 常に true と見做すのをやめ、現在の終了ステータスに従って条件判断する?
  • 終了ステータスを 0 にする?

↓ このテスト以外にもいろいろテストを変える必要あり。(特に前者にする場合) https://github.com/magicant/yash/blob/fd5f64f99b923944e4700dda2383dd096c4823c3/tests/if-y.tst#L46

Ticket History (2/2 Histories)

2016-01-12 00:15 Updated by: magicant
  • New Ticket "If/while/until 空条件の解釈" created
2016-01-14 23:37 Updated by: magicant
  • Priorité Update from 5 - moyen to 3
  • Sévérité Update from 5 - moyen to 3

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion