Shell's mistake

xiaoxiao2021-03-06  45

In fact, it is just a very simple issue. What I want to find the information containing the character "abcd" in the file of the current directory, so I gave it, but I found that the output information is more, so I decide to redirect. Then, I found the mist to the shell.

Because this simple single shell command has not stopped: GREP "abcd" *> my.log

So, I stopped it, and I found that the newly generated file my.log has increased, and the danger is used by vi. It is clear. Come in.

The problem is coming, when redirect, the shell should explain the wildcard first or you should create a file first?

I remember that this operation was often performed in HP-UX, nor did it have problems, and it seems that different platforms, different shells have a big difference.

Note: Platform Sunos 5.8, Shell / Bin / CSH

转载请注明原文地址:https://www.9cbs.com/read-74850.html

New Post(0)