Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to generate Calendar Mini Program in shell using AWK

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use AWK to generate calendar Mini Program in shell". In daily operation, I believe many people have doubts about how to use AWK to generate calendar Mini Program in shell. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to use AWK to generate calendar Mini Program in shell". Next, please follow the editor to study!

Code snippet:

# generate calendar in shell # usage # awk-f thisfile + 2011calendar awk-f thisfile + 2017.1calendar awk-f thisfile + 2017.10.10#function whichweek (y, m, d S) {s = 0 if (y% 4 = = 0) & & (y0! = 0)) | | (y% 400 = = 0) if (m [2] = = 28) m [2] + + if (y > 0) s + =-y + int (yUniver 4)-int (yUniver 400) + int (ycan400) while (m > 1) s + = m [- m] return (sqd)% 7} function printcalendar (y, m, d, nowweek) I) {printf ("% d% s% d% s\ n", y, "year", m, "month") print "day one, two, three, four, five, six" printf ("% s", repeat (", (nowweek+1)% 7) * 3) for (iTun1) I

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report