2 ############################################################
4 # author: devenkong(18151155@qq.com)
6 ############################################################
7 # Copyright (C) 2022- Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software
9 # Foundation gives unlimited permission to copy, distribute
11 ############################################################
13 # shlib option program. if this cmd is used for set global
14 # paramters, use 'source shlibopt' instead of single shlibopt.
15 ############################################################
28 ##############################
29 # section: public comment info
30 ##############################
35 ##############################
36 # section: variable define
37 ##############################
42 ##############################
43 # section: private function
44 ##############################
49 ##############################
50 # section: public function
51 ##############################
55 syntax: shlibopt [option] <paramter>
56 description: set paramters for shlib using.
59 -a <path> append path to shlib path.
60 -d [N] delete the N th path item. zero or none paramter delete
61 the latest path in shlib path.
63 -l list shlib files in include path.
64 -i <file> install file to shlib path.
65 -u <file> uninstall file from shlib path.
67 -b init shlib on system boot.
68 -s <user> init shlib on session init.
69 -p init shlib on program start.
71 -v print shlib version info.
72 -h helper information.
86 init_dbglogout
2 shlibopt
20000
91 while getopts :ga
:d
:li
:u
:bspvh opt
; do
92 eval optstr
=\
${$OPTIND}
100 echo "optstr=$optstr"
110 get_shlib_path |
while read line
; do
111 echo -ne "\033[32m[$line]\n\033[0m"
112 find $line/* |
grep -E "\.shlib"
116 tmp
=( $
(get_shlib_path
) )
120 tmp
=( $
(get_shlib_path
) )
126 if [[ -z "$(cat $ROOTFS/etc/bash.bashrc | grep -E '. shlibinc')" ]]; then
127 echo ". shlibinc" > $ROOTFS/etc
/bash.bashrc
131 if [[ -z "$(cat $ROOTFS/home/$user/.bashrc | grep -E '. shlibinc')" ]]; then
132 echo ". shlibinc" > $ROOTFS/home
/$user/.bashrc
140 info
"shlib v$SHLIB_VERSION"
143 info
"$shlibopt_usage"
146 warn
"does not use '-$opt' opt.\n"
157 ##############################
159 ##############################