「Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.」と表示されコマンドラインで操作ができなくなる

先日macのターミナルからコマンド操作をしようとしたら以下の様なメッセージが表示されコマンドが実行できなくなりました。

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

「Xcodeのライセンスが更新されたから承諾しろや」と、言う事らしいんですが、突然表示されるので焦ります。。。
直前のコマンドをsudo付けて再度実行すると先に進め、以下の対話状態になります。

You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
Hit the Enter key to view the license agreements at '/Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf’
 ↑何か適当にキーをおします。エンターキーとか。
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
 ↑"agree"とタイプする事で同意となり終了します。

canselするか、agree以外のタイプをすると一旦終了しますが、何らかのコマンド入力をすると、最初のメッセージが表示され先に進めません。。。
他の手順もあるようですが、同意しない(Xcodeを使わない)という選択が”出来ない”のであれば、”agree”して本来の作業にさくっと戻るのがよいかと。