呉裕雄--天生自然ShellX学习笔记:Shell echo命令

3825 ワード

Shell   echo     PHP   echo     ,          。    :
echo string
     echo            。
1.       :
echo "It is a test"
            ,             :
echo It is a test
2.      
echo "\"It is a test\""
    :
"It is a test"
3.    
read             ,                shell   
#!/bin/sh
read name 
echo "$name It is a test"
        test.sh,name          ,    :
[root@www ~]# sh test.sh
OK                     #    
OK It is a test        #  
4.    
echo -e "OK! 
" # -e echo "It is a test" : OK! It is a test
5.     
#!/bin/sh
echo -e "OK! \c" # -e      \c    
echo "It is a test"
    :
OK! It is a test

6.         
echo "It is a test" > myfile

7.       ,         (    )
echo '$name\"'
    :
$name\"
8.        
echo `date`
  :           `,        '

         
Thu Jul 24 10:08:46 CST 2014