有没有在bash中命名“私有函数”的约定?
发布时间:2020-12-16 01:30:30 所属栏目:安全 来源:网络整理
导读:有没有在bash中命名私有函数的惯例? 我有一个带有一些私有功能的bash模块,想知道我是否应该用下划线启动他们的名字. 到目前为止,我还没有看到任何约定. 对于什么值得,Red Hat的/etc/init.d/functions脚本使用双重下划线. # __umount_loop awk_program fstab
有没有在bash中命名私有函数的惯例?
我有一个带有一些私有功能的bash模块,想知道我是否应该用下划线启动他们的名字. 到目前为止,我还没有看到任何约定.
对于什么值得,Red Hat的/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' (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |