⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 echo.c

📁 操作系统源代码
💻 C
字号:
/* * Echo command. * * Copyright (C) 1989 by Kenneth Almquist.  All rights reserved. * This file is part of ash, which is distributed under the terms specified * by the Ash General Public License.  See the file named LICENSE. */#define main echocmd#include "bltin.h"#undef eflagmain(argc, argv)  char **argv; {      register char **ap;      register char *p;      register char c;      int count;      int nflag = 0;#ifndef eflag      int eflag = 0;#endif      ap = argv;      if (argc)	    ap++;      if ((p = *ap) != NULL) {	    if (equal(p, "--")) {		  ap++;	    }	    if (equal(p, "-n")) {		  nflag++;		  ap++;	    } else if (equal(p, "-e")) {#ifndef eflag		  eflag++;#endif		  ap++;	    }      }      while ((p = *ap++) != NULL) {	    while ((c = *p++) != '\0') {		  if (c == '\\' && eflag) {			switch (*p++) {			case 'b':  c = '\b';  break;			case 'c':  return 0;		/* exit */			case 'f':  c = '\f';  break;			case 'n':  c = '\n';  break;			case 'r':  c = '\r';  break;			case 't':  c = '\t';  break;			case 'v':  c = '\v';  break;			case '\\':  break;		/* c = '\\' */			case '0':			      c = 0;			      count = 3;			      while (--count >= 0 && (unsigned)(*p - '0') < 8)				    c = (c << 3) + (*p++ - '0');			      break;			default:			      p--;			      break;			}		  }		  putchar(c);	    }	    if (*ap)		  putchar(' ');      }      if (! nflag)	    putchar('\n');      return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -