简体   繁体   English

与cat,awk和命令无法重定向结果到txt文件

[英]with cat,awk and command unable to redirect result in txt file

I am using AIX for following code: 我将AIX用于以下代码:

#!/bin/sh
cat ip.txt | awk -F ' ' '{print $1,$3}' >op.txt

or 要么

awk -F ' ' '{print $1,$3}' ip.txt > op2.txt

So it generating file named "oxb1du" which unknown file.. Please help me 因此它生成了一个名为“ oxb1du”的未知文件。.请帮助我

I/P file: I / P文件:

name 1
info 21
city 28
pin  31
state 34

Do you have an example of the text that is in the ip.txt file? 您是否有ip.txt文件中的文本示例? so we can see the format 所以我们可以看到格式

You can also run the command without redirection the output in a file and observe what is happening. 您也可以运行命令而无需将输出重定向到文件中,并观察正在发生的情况。

As Utsaw said it is quite unlikely that this command has created the strange file. 正如Utsaw所说,此命令不太可能创建奇怪的文件。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM