简体   繁体   English

为什么它不执行文本文件?

[英]why doesn't it execute text file?

#!/bin/bash
touch network_detials.txt

while true; do
ifconfig -a | cat >> network_detials.txt
done

Not executing properly or creating.txt file from TOUCH creation未正确执行或从 TOUCH 创建中创建 .txt 文件

  1. Piping through cat usually doesn't change or help anything.通过cat管道通常不会改变或帮助任何事情。
  2. touch ing the file may seem nice, but it is also superfulous since >> will create the file if needed. touch文件可能看起来不错,但它也是多余的,因为>>将在需要时创建文件。
  3. Nothing about your problem indicates a problem with execution.您的问题没有任何迹象表明执行存在问题。
  4. Please indent within the while loop.请在while循环内缩进。

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

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