CLIで英語の単語をドイツ語に翻訳するには?

CLIで英語の単語をドイツ語に翻訳するには?

/usr/share/dict/words英語の単語をランダムに選択してドイツ語に翻訳し、しばらく表示してプロセスを繰り返すスクリプトを作成したいと思います。私は始まりだけを知っており、シェルで単語から単語への翻訳を使用する方法はわかりません。

watch -n5 sh -c 'cat /usr/share/dict/words | shuf -n1 | .....'

ベストアンサー1

ダウンロード翻訳シェル

cd
wget https://github.com/soimort/google-translate-cli/archive/master.tar.gz
tar -xvf master.tar.gz
cd google-translate-cli-master/

インストールする

  • 使用make

    sudo make install
    

    または

  • 使用checkinstall

    sudo apt-get install checkinstall
    sudo checkinstall
    

    これを見るなら:3 - Version: [ master ]それなら

    • ~によると3
    • たとえば、数字を入力してください。20150330
    • ~によるとReturn

次のように翻訳

cat /usr/share/dict/words | shuf -n1 | tee >( xargs -0 trs {=de} | xargs echo) | xargs -0 echo -n

注文

watch -n5 'bash -c "cat /usr/share/dict/words | shuf -n1 | tee >( xargs -0 trs {=de} | xargs echo) | xargs -0 echo -n"'

おすすめ記事