2010-02-18 38 views

回答

12

值得一提的是,紅帽的/etc/init.d/functions腳本使用雙下劃線。

# __umount_loop awk_program fstab_file first_msg retry_msg umount_args 
# awk_program should process fstab_file and return a list of fstab-encoded 
# paths; it doesn't have to handle comments in fstab_file. 
__umount_loop() { 
    # ... 
} 

# Similar to __umount loop above, specialized for loopback devices 
__umount_loopback_loop() { 
    # ... 
} 

# __proc_pids {program} [pidfile] 
# Set $pid to pids from /var/run* for {program}. $pid should be declared 
# local in the caller. 
# Returns LSB exit code for the 'status' action. 
__pids_var_run() { 
    # ... 
} 

# A sed expression to filter out the files that is_ignored_file recognizes 
__sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' 
3

我不知道任何正式的bash特定約定,但使用下劃線開始私有標識符是一種相當普遍的語言獨立約定(我在從C到Perl到Java到shell腳本的任何事情上遇到過)。

相關問題