linux - unix管道命令的问题

标签 linux command-line

我在一个文本文件中有一个目录名列表。我想将它们用作 git-svn clone 命令的 file_name 的一部分。

这将逐行打印出文件的内容。

cat repos_to_migrate.txt | tee $1

但这不起作用:

cat repos_to_migrate.txt | git svn clone file:///home/svn/$1
... Unable to open repository 'file:///home/svn' ...

这里有什么想法吗?我运行的是 centos5 很重要。

最佳答案

(
    while read repo; do
        git svn clone file:///home/svn/$repo
    done
) < repos_to_migrate.txt

关于linux - unix管道命令的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4622835/

相关文章:

c++ - 使用 gcc 编译基于 DocxFactory 的应用程序

c - 缓冲区较小时的简单混响算法

command-line - 如何在命令行(cmd)中运行java类? (使用类路径)

swift - macOS 命令行代码在 Swift 中获取数据的现代方式,并带有进度通知

php exec() 不适用于 PredictionIO 部署

command-line - Microsoft Jet 数据库引擎是否存在命令行客户端?

linux - 如何在 Ubuntu11.04 中使用 NASM 维护堆栈

linux - Apache 子域目录到外部服务器

python - 在 Linux 中获取进程的最大 CPU/RAM 使用率

regex - Windows 中的 Perl 单行代码