ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • HPUX - Quoting
    IoT 과정 2017. 6. 21. 17:32
    반응형

    Quoting Introduce


    Many characters have 'special' meaning to the shell :
    white space, carriage return, $, #, *, < >

    Quoting removes the special meaning of the special characters:

    eg) rm='rm -i', MYNAME="YO HAN"


    Quoting - back slash (\)

    $ color=red\ white\ and blue

    sh: blue:  not found.

    $ color=red\ white\ and\ blue

    $ echo $color

    red white and blue

    $ echo one two \                            //carriage return

    >

    one two


    Quoting - '  , Removes the special meaning of all characters surrounded by the single quotes

    $ color='red white and blue'

    $ echo 'the value of \$color is $color'

    the value of \$color is $color


    Quoting - " , Removes the special meaning of all characters surrounded by double quotes except \, $variable name, $(cmd), and "

    $ echo "the value of \$color is $color"
    the value of $color is red white and blue


    end of book1

    * man sh-posix     //필요한 것들은 참조를 하자



    반응형

    'IoT 과정' 카테고리의 다른 글

    HPUX - Pipes  (0) 2017.06.22
    HPUX - Input and Output Redirection  (0) 2017.06.22
    HPUX - Quoting  (0) 2017.06.21
    HPUX - File Name Generation  (0) 2017.06.21
    HPUX - Shell Advanced Features  (0) 2017.06.21
    HPUX - Shell Basic  (0) 2017.06.21

    댓글 0

Designed by Tistory.