简体   繁体   English

如何以递归方式在UNIX中打印文件的列?

[英]how to print the column of a file in unix recursively?

I want to print the columns of a file in unix to a temp file.Below is the code that i have wrote but its not giving proper output. 我想将unix文件的列打印到临时文件。以下是我编写的代码,但没有给出正确的输出。

#!/bin/bash

CURRENT_DATE=`date +'%d%m%Y'`
Temp_Path=/appinfprd/bi/Scripts/IRP/New_Vendors/
IRP_PROJECT/SXM_SFTP/*/INBOUND -type f head -1|xargs -0 ls -al  > "$Temp_Path/Column_$CURRENT_DATE.txt"

Solution with find command only 仅使用find命令的解决方案

find \
IRP_PROJECT/SXM_SFTP/*/INBOUND \
-type f \
-exec head -1 {} \; \
 > "$Temp_Path/Column_$CURRENT_DATE.txt"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何grep文件然后将其打印出来? Unix的 - How to grep a file then print it out? Unix Unix:在各自的文件夹中递归解压缩.zip文件 - Unix:Recursively unzipping .zip file in respective folder Unix命令递归地生成文件和文件夹 - Unix command to make file and folders recursively unix / bash:如何仅打印列中的某些字符串 - unix/bash: how to print only certain strings from a column 如何根据第一列在unix中打印范围 - How to print range in unix based on the 1st column 如何在不使用find或-type的情况下递归计算unix目录中每种文件的数量? - How can I recursively count the number of each type of file in a unix directory without using find or -type? 如何在Unix中同时写入文件并打印到终端? - How do I write to a file and print to a terminal concurrently in Unix? 如何根据UNIX第一栏中的字符串给文件编号? - How numbered a file based on the string in first column in unix? 我可以通过Unix进行哈希处理吗,在该哈希中,一列中的每一行都打印与其他选项卡文件中另一列相对应的所有重合 - Could I perform a hash by Unix in which for every row in one column print all coincidences corresponding to other column within other tab file unix-在文件中打印控制字符的不同列表 - unix - print distinct list of control characters in a file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM