The implementation process and the results of shell scripts into log file

[root @ localhost scripts] # vim the ping . SH  
# / bin /! bash 
the SET - the X-    ## step execution 
Exec &> /tmp/log.txt   ## during script execution and results of the import file /tmp/log.txt in 

for ip in ` seq  1  10 `
 do 
    IF ! the ping -c1 192.168 . 10 . $ ip; the then 
        echo $ ip 
        Exit 
    fi 
DONE

 

Guess you like

Origin www.cnblogs.com/carriezhangyan/p/11319862.html