Monday, November 4, 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. 


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 
# be in /etc/bash_completion.d anyway; not doing the test improves our 
# time significantly. 
#PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && 


Post a Comment

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