开发者

How to make infinite loop with awk

开发者 https://www.devze.com 2023-02-23 07:16 出处:网络
I have a program: #!/bin/awk -f BEGIN { } { print \"hello\" } END { } It prints hello and then waits for enter to be pressed and then again prints hello.

I have a program:

#!/bin/awk -f
BEGIN {
}
{
        print "hello"       
}
END {
}

It prints hello and then waits for enter to be pressed and then again prints hello. i want to make i开发者_Go百科t infinite without asking for enter. Please comment!


Agreed with @SiegeX

yes | awk '{ print "hello" }'


#!/bin/awk -f

BEGIN{
  while(1)
    print "hello"
}
0

精彩评论

暂无评论...
验证码 换一张
取 消