linux的wc命令源代码,linux下的wc命令的源代码

 2023-09-15 阅读 18 评论 0

摘要:自己写得简易WC.c可以帮助理解initialize_main (&argc, &argv); set_program_name (argv[0]); setlocale (LC_ALL, "");bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);atexit (close_stdout);/* Line buffer stdout to ensure lines are writte

自己写得简易WC.c可以帮助理解

initialize_main (&argc, &argv); set_program_name (argv[0]); setlocale (LC_ALL, "");

bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE);

atexit (close_stdout);

/* Line buffer stdout to ensure lines are written atomically and immediately so that processes running in parallel do not intersperse their output. */ setvbuf (stdout, NULL, _IOLBF, 0);

linux中wc命令,print_lines = print_words = print_chars = print_bytes = false; print_linelength = false;

total_lines = total_words = total_chars = total_bytes = max_line_length = 0;

while ((optc = getopt_long (argc, argv, "clLmw", longopts, NULL)) != -1) switch (optc) {

case 'c':

print_bytes = true; break;

case 'm':

linux man命令的使用。print_chars = true; break;

case 'l':

print_lines = true; break;

case 'w':

print_words = true; break;

case 'L':

linux chmod命令,print_linelength = true; break;

case FILES0_FROM_OPTION: files_from = optarg; break;

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/60154.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息