Tuesday, October 15, 2013

Have String in Command's Completion

www.unixbabuforum.inWhen I read completion files of command like ssh, All of them starts like below: 

have ssh && { 

Some Codes....... 



What is have and What is && here? 
and there isn't any have command in machine! 

www.unixbabuforum.insee /etc/bash_completion 

"have" is a function 

----- 
# This function checks whether we have a given program on the system. 
# No need for bulky functions in memory if we don't. 

have() 

unset -v have 
# Completions for system administrator commands are installed as well in 
# case completion is attempted via `sudo command ...'. 
# In this packaged setup we don't need to do the availability test below 
# because only completions for commands that are actually available 
should 
# be in /etc/bash_completion.d anyway; not doing the test improves our 
load 
# time significantly. 
#PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && 
have="yes" 




0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM