如何跨多个目录使用 genstrings? [英] How to use genstrings across multiple directories?

查看:11
本文介绍了如何跨多个目录使用 genstrings?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个目录,里面有很多子目录.这些子目录有时甚至有子目录.里面有源文件.

I have an directory, which has a lot of subdirectories. those subdirs sometimes even have subdirs. there are source files inside.

如何使用 genstrings 遍历所有这些目录和子目录?

How could I use genstrings to go across all these dirs and subdirs?

假设我在终端中 cd 到我的根目录,然后我会输入:

Let's say I cd to my root dir in Terminal, and then I would type this:

genstrings -o en.lproj *.m

我现在如何告诉它查看所有这些目录?还是我必须添加很多以逗号分隔的相对路径?怎么样?

How could I tell it now to look into all these directories? Or would I have to add a lot of relative paths comma separated? how?

推荐答案

一种方法是:

find ./ -name "*.m" -print0 | xargs -0 genstrings -o en.lproj

xargs 是一个很好的 shell-foo 块.它将采用标准输入字符串并将它们转换为下一个函数的参数.这将使用当前目录下的每个 .m 文件填充您的 genstrings 命令.

xargs is a nice chunk of shell-foo. It will take strings on standard in and convert them into arguments for the next function. This will populate your genstrings command with every .m file beneath the current directory.

此答案处理已用路径中的空格,因此更健壮.您应该使用它来避免在处理源文件时跳过文件.

This answer handels spaces in the used path so it is more robust. You should use it to avoid skipping files when processing your source files.

正如评论和其他答案中所说, *.m 应该被引用.

as said in the comments and in other answers, *.m should be quoted.

这篇关于如何跨多个目录使用 genstrings?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆