2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

config/locales配下のja.yamlを全部印刷する方法

Last updated at Posted at 2016-01-25

前提

config/localesディレクトリをカレントディレクトリとして作業しています。

まず確認

find . -type f -name '*ja*' -print
で期待するファイル名が取れることを確認する

execで印刷する

(execやめてcatで一回連結したほうがよいかと... この記事の次の項目参照)
find . -type f -name '*ja*' -exec lp {} \;

最後{}\;とスペースなしで連続して書いたら

find: -exec: no terminating ";" or "+"

というエラーが出るので注意。
Linux - find の -exec optionの末尾につく ; と + の違い。 - Qiita

\;+には上記のような違いがあるようだけど、今回のは繋げて書いたのが原因なので、違いはあんまり関係なかったが、違いがあることを知った。

さすがに枚数が多すぎた!

さすがに枚数が多すぎたので
cat **/ja.yml >> ja_all.txt
で1ファイルにして印刷しよう。

ファイル名も明記したい!!

for f in **/ja.yml; do
	echo ""
    echo "$f"
    cat "$f"
done > ja_all.txt

参考:http://superuser.com/a/532152/249264

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?