javran吧 关注:7贴子:154
  • 3回复贴,共1

[Javran][Work]Shell编程的尝试

取消只看楼主收藏回复

0


1楼2007-07-28 11:55回复
    主要命令介绍:
    ECHO(1) User Commands ECHO(1)

    NAME
     echo - display a line of text

    SYNOPSIS
     echo [OPTION]... [STRING]...

    DESCRIPTION
     Echo the STRING(s) to standard output.

     -n do not output the trailing newline

     -e enable interpretation of backslash escapes

     -E disable interpretation of backslash escapes (default)

     --help display this help and exit

     --version
     output version information and exit

     If -e is in effect, the following sequences are recognized:

     \0NNN the character whose ASCII code is NNN (octal)

     \\ backslash

     \a alert (BEL)

     \b backspace

     \c suppress trailing newline

     \f form feed

     \n new line

     \r carriage return

     \t horizontal tab

     \v vertical tab

     NOTE: your shell may have its own version of echo, which usually super‐
     sedes the version described here. Please refer to your shell’s docu‐
     mentation for details about the options it supports.

    AUTHOR
     Written by FIXME unknown.

    REPORTING BUGS
     Report bugs to <bug-coreutils@gnu.org>.

    COPYRIGHT
     Copyright © 2006 Free Software Foundation, Inc.
     This is free software. You may redistribute copies of it under the
     terms of the GNU General Public License
     <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
     extent permitted by law.

    SEE ALSO
     The full documentation for echo is maintained as a Texinfo manual. If
     the info and echo programs are properly installed at your site, the
     command

     info echo

     should give you access to the complete manual.

    echo 5.97 March 2007 ECHO(1)


    2楼2007-07-28 11:58
    回复
      ECHO(1) User Commands ECHO(1)

      NAME
      语法:
       echo [参数]... [字符串]...

      描述:
       将字符(串)输出到标准输出流

       -n 输出不换行

       -e 反斜杆解释有效

       -E 不解释反斜杆(默认)

       --help 输出本消息并退出

       --version
       输出版本信息并退出

      如果 -e 参数存在,下列字符将被解释:

       \0NNN 输出 ASCII码为 NNN 的数(NNN为八进制数)

       \\ 反斜杆

       \a 警报(响铃)

       \b 退格

       \c 阻止输出新行

       \f 换页 

       \n 新行

       \r 回车

       \t 水平Tab

       \v 纵向 Tab


      3楼2007-07-28 12:12
      回复
        #!/bin/bash
        ## 可能是语言解释器选择命令
        k=1
        ## 定义变量
        while ((k<10))
        do
        echo "$k"
        ##输出
        ((k=k+1))
        done


        本人的第一个shell程序,输出1-10


        4楼2007-07-28 13:00
        回复